取得 Devops 長時間執行的作業結果。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/operationResults/{operationResultId}?api-version=2024-04-01
URI 參數
名稱 |
位於 |
必要 |
類型 |
Description |
operationResultId
|
path |
True
|
string
|
作業結果標識碼。
|
resourceGroupName
|
path |
True
|
string
|
資源群組的名稱。 名稱不區分大小寫。
|
securityConnectorName
|
path |
True
|
string
|
安全性連接器名稱。
|
subscriptionId
|
path |
True
|
string
|
目標訂用帳戶的標識碼。
|
api-version
|
query |
True
|
string
|
要用於這項作業的 API 版本。
|
回應
安全性
azure_auth
Azure Active Directory OAuth2 Flow
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 |
Description |
user_impersonation
|
模擬您的用戶帳戶
|
範例
Get_DevOpsOperationResults_Failed
範例要求
GET https://management.azure.com/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/8d4caace-e7b3-4b3e-af99-73f76829ebcf?api-version=2024-04-01
/**
* Samples for DevOpsOperationResults Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-04-01/examples/SecurityConnectorsDevOps/
* GetDevOpsOperationResultsFailed_example.json
*/
/**
* Sample code: Get_DevOpsOperationResults_Failed.
*
* @param manager Entry point to SecurityManager.
*/
public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) {
manager.devOpsOperationResults().getWithResponse("myRg", "mySecurityConnectorName",
"8d4caace-e7b3-4b3e-af99-73f76829ebcf", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.security import SecurityCenter
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-security
# USAGE
python get_dev_ops_operation_results_failed_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SecurityCenter(
credential=DefaultAzureCredential(),
subscription_id="0806e1cd-cfda-4ff8-b99c-2b0af42cffd3",
)
response = client.dev_ops_operation_results.get(
resource_group_name="myRg",
security_connector_name="mySecurityConnectorName",
operation_result_id="8d4caace-e7b3-4b3e-af99-73f76829ebcf",
)
print(response)
# x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-04-01/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"id": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/8d4caace-e7b3-4b3e-af99-73f76829ebcf?api-version=2024-04-01",
"name": "8d4caace-e7b3-4b3e-af99-73f76829ebcf",
"status": "Failed",
"startTime": "2023-06-21T03:23:15Z",
"endTime": "2023-06-21T03:25:15Z",
"percentComplete": 100,
"error": {
"code": "TokenExchangeFailed",
"message": "AzureDevOps OAuth token exchange failed"
}
}
Get_DevOpsOperationResults_Succeeded
範例要求
GET https://management.azure.com/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/4e826cf1-5c36-4808-a7d2-fb4f5170978b?api-version=2024-04-01
/**
* Samples for DevOpsOperationResults Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-04-01/examples/SecurityConnectorsDevOps/
* GetDevOpsOperationResultsSucceeded_example.json
*/
/**
* Sample code: Get_DevOpsOperationResults_Succeeded.
*
* @param manager Entry point to SecurityManager.
*/
public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) {
manager.devOpsOperationResults().getWithResponse("myRg", "mySecurityConnectorName",
"4e826cf1-5c36-4808-a7d2-fb4f5170978b", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.security import SecurityCenter
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-security
# USAGE
python get_dev_ops_operation_results_succeeded_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SecurityCenter(
credential=DefaultAzureCredential(),
subscription_id="0806e1cd-cfda-4ff8-b99c-2b0af42cffd3",
)
response = client.dev_ops_operation_results.get(
resource_group_name="myRg",
security_connector_name="mySecurityConnectorName",
operation_result_id="4e826cf1-5c36-4808-a7d2-fb4f5170978b",
)
print(response)
# x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-04-01/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
{
"id": "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/4e826cf1-5c36-4808-a7d2-fb4f5170978b?api-version=2024-04-01",
"name": "4e826cf1-5c36-4808-a7d2-fb4f5170978b",
"status": "Succeeded",
"startTime": "2023-06-21T03:23:15Z",
"endTime": "2023-06-21T03:25:15Z",
"percentComplete": 100
}
定義
ErrorAdditionalInfo
資源管理錯誤其他資訊。
名稱 |
類型 |
Description |
info
|
object
|
其他資訊。
|
type
|
string
|
其他信息類型。
|
ErrorDetail
錯誤詳細數據。
名稱 |
類型 |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
錯誤其他資訊。
|
code
|
string
|
錯誤碼。
|
details
|
ErrorDetail[]
|
錯誤詳細數據。
|
message
|
string
|
錯誤訊息。
|
target
|
string
|
錯誤目標。
|
ErrorResponse
錯誤回應
OperationStatusResult
異步操作的目前狀態。
名稱 |
類型 |
Description |
endTime
|
string
|
作業的結束時間。
|
error
|
ErrorDetail
|
如果有,作業錯誤的詳細數據。
|
id
|
string
|
異步作業的完整標識碼。
|
name
|
string
|
異步作業的名稱。
|
operations
|
OperationStatusResult[]
|
作業清單。
|
percentComplete
|
number
|
完成的作業百分比。
|
startTime
|
string
|
作業的開始時間。
|
status
|
string
|
作業狀態。
|