你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Sessions - Close

关闭现有会话。

POST https://{region}.{serviceBaseUrl}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}:close?api-version=2024-10-01-preview

URI 参数

名称 必需 类型 说明
region
path True

string

Azure Quantum 工作区所在的 Azure 区域。

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[a-zA-Z][a-zA-Z0-9\-_\.]*$

Azure 资源组的名称。

serviceBaseUrl
path True

string

Azure Quantum 服务基 URL。

sessionId
path True

string

maxLength: 36
pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$

会话的 ID。

subscriptionId
path True

string

minLength: 36
maxLength: 36
pattern: ^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$

Azure 订阅 ID。

workspaceName
path True

string

minLength: 2
maxLength: 50
pattern: ^[a-zA-Z][a-zA-Z0-9\-_]*$

Azure Quantum 工作区的名称。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

响应

名称 类型 说明
200 OK

SessionDetails

请求已成功。

Other Status Codes

Azure.Core.Foundations.ErrorResponse

意外的错误响应。

标头

x-ms-error-code: string

安全性

AzureEntraAuth

Azure Entra OAuth2 身份验证

类型: oauth2
流向: application
令牌 URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

作用域

名称 说明
https://quantum.microsoft.com/.default

x-ms-quantum-api-key

Azure Api-Key 身份验证

类型: apiKey
在: header

示例

Closes a session by its id.

示例请求

POST https://{region}.{serviceBaseUrl}/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Quantum/workspaces/my-workspace/sessions/60ba7795-6a13-4630-aec0-260b3904378c:close?api-version=2024-10-01-preview

示例响应

{
  "name": "VQE Session",
  "id": "60ba7795-6a13-4630-aec0-260b3904378c",
  "itemType": "Session",
  "beginExecutionTime": "2020-09-30T23:57:11.5659691Z",
  "creationTime": "2020-09-30T23:57:02.3737928+00:00",
  "endExecutionTime": "2020-09-30T23:57:11.6180743Z",
  "errorData": null,
  "jobFailurePolicy": "Abort",
  "providerId": "ionq",
  "status": "Succeeded",
  "target": "ionq.qpu"
}

定义

名称 说明
Azure.Core.Foundations.Error

错误对象。

Azure.Core.Foundations.ErrorResponse

包含错误详细信息的响应。

Azure.Core.Foundations.InnerError

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors

CostEstimate

提供程序计费的作业成本。 由于加税和货币换算率,帐单的最终成本可能略有不同。

Errors.WorkspaceItemError

错误对象。

ItemType

工作区项的类型。

SessionDetails

会话,作业的逻辑分组。

SessionJobFailurePolicy

策略控制会话中作业失败时会话的行为。

SessionStatus

会话的状态。

UsageEvent

使用情况事件详细信息。

Azure.Core.Foundations.Error

错误对象。

名称 类型 说明
code

string

服务器定义的错误代码集之一。

details

Azure.Core.Foundations.Error[]

导致此报告错误的特定错误的详细信息数组。

innererror

Azure.Core.Foundations.InnerError

包含与当前对象有关错误的更具体信息的对象。

message

string

错误的人工可读表示形式。

target

string

错误的目标。

Azure.Core.Foundations.ErrorResponse

包含错误详细信息的响应。

名称 类型 说明
error

Azure.Core.Foundations.Error

错误对象。

Azure.Core.Foundations.InnerError

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors

名称 类型 说明
code

string

服务器定义的错误代码集之一。

innererror

Azure.Core.Foundations.InnerError

内部错误。

CostEstimate

提供程序计费的作业成本。 由于加税和货币换算率,帐单的最终成本可能略有不同。

名称 类型 说明
currencyCode

string

货币代码。

estimatedTotal

number (float)

估计总计。

events

UsageEvent[]

使用情况事件列表。

Errors.WorkspaceItemError

错误对象。

名称 类型 说明
code

string

服务器定义的错误代码集之一。

details

Azure.Core.Foundations.Error[]

导致此报告错误的特定错误的详细信息数组。

innererror

Azure.Core.Foundations.InnerError

包含与当前对象有关错误的更具体信息的对象。

message

string

错误的人工可读表示形式。

target

string

错误的目标。

ItemType

工作区项的类型。

说明
Job

提交用于处理的程序、问题或应用程序。

Session

作业的逻辑分组。

SessionDetails

会话,作业的逻辑分组。

名称 类型 说明
beginExecutionTime

string (date-time)

项开始执行的时间。

costEstimate

CostEstimate

成本估算。

creationTime

string (date-time)

项的创建时间。

endExecutionTime

string (date-time)

项目完成执行的时间。

errorData

Errors.WorkspaceItemError

错误信息。

id

string

maxLength: 36
pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$

会话的 ID。

itemType string:

Session

Quantum 工作区项的类型

jobFailurePolicy

SessionJobFailurePolicy

策略控制会话中作业失败时会话的行为。

name

string

项的名称。 名称不一定是唯一的,它仅用于显示目的。

providerId

string

提供程序的唯一标识符。

status

SessionStatus

会话的状态。

target

string

要运行作业的目标标识符。

SessionJobFailurePolicy

策略控制会话中作业失败时会话的行为。

说明
Abort

作业失败后提交的新作业将被拒绝。

Continue

将接受作业失败后提交的新作业。

SessionStatus

会话的状态。

说明
Executing

正在执行会话。

Failed

会话已完成,失败。

Failure(s)

会话已完成,但出现一些失败。

Succeeded

会话成功完成。

TimedOut

会话超时。

Waiting

会话正在等待队列中执行。

UsageEvent

使用情况事件详细信息。

名称 类型 说明
amountBilled

number (float)

计费金额。

amountConsumed

number (float)

消耗的量。

dimensionId

string

维度 ID。

dimensionName

string

维度名称。

measureUnit

string

度量单位。

unitPrice

number (float)

单价。