Uzyskaj stan długotrwałej operacji asynchronicznej platformy Azure.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}?api-version=2020-08-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
asyncOperationId
|
path |
True
|
string
|
Identyfikator operacji.
|
location
|
path |
True
|
string
|
Nazwa regionu operacji.
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji docelowej.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
Odpowiedzi
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
Get specific operation status
Przykładowe żądanie
GET https://management.azure.com/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/providers/Microsoft.OperationalInsights/locations/West US/operationStatuses/713192d7-503f-477a-9cfe-4efc3ee2bd11?api-version=2020-08-01
/** Samples for OperationStatuses Get. */
public final class Main {
/*
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json
*/
/**
* Sample code: Get specific operation status.
*
* @param manager Entry point to LogAnalyticsManager.
*/
public static void getSpecificOperationStatus(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
manager
.operationStatuses()
.getWithResponse("West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", 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.loganalytics import LogAnalyticsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-loganalytics
# USAGE
python operation_statuses_get.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 = LogAnalyticsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="613192d7-503f-477a-9cfe-4efc3ee2bd60",
)
response = client.operation_statuses.get(
location="West US",
async_operation_id="713192d7-503f-477a-9cfe-4efc3ee2bd11",
)
print(response)
# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.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
package armoperationalinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json
func ExampleOperationStatusesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armoperationalinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOperationStatusesClient().Get(ctx, "West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.OperationStatus = armoperationalinsights.OperationStatus{
// Name: to.Ptr("713192d7-503f-477a-9cfe-4efc3ee2bd11"),
// EndTime: to.Ptr("2017-01-01T16:13:13.933Z"),
// ID: to.Ptr("/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/locations/westus/operationStatuses/713192d7-503f-477a-9cfe-4efc3ee2bd11"),
// StartTime: to.Ptr("2017-01-01T13:13:13.933Z"),
// Status: to.Ptr("Succeeded"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the status of a long running azure asynchronous operation.
*
* @summary Get the status of a long running azure asynchronous operation.
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json
*/
async function getSpecificOperationStatus() {
const subscriptionId =
process.env["OPERATIONALINSIGHTS_SUBSCRIPTION_ID"] || "613192d7-503f-477a-9cfe-4efc3ee2bd60";
const location = "West US";
const asyncOperationId = "713192d7-503f-477a-9cfe-4efc3ee2bd11";
const credential = new DefaultAzureCredential();
const client = new OperationalInsightsManagementClient(credential, subscriptionId);
const result = await client.operationStatuses.get(location, asyncOperationId);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/locations/westus/operationStatuses/713192d7-503f-477a-9cfe-4efc3ee2bd11",
"name": "713192d7-503f-477a-9cfe-4efc3ee2bd11",
"startTime": "2017-01-01T13:13:13.933Z",
"endTime": "2017-01-01T16:13:13.933Z",
"status": "Succeeded"
}
Definicje
ErrorAdditionalInfo
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorDetail
Szczegóły błędu.
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
ErrorDetail[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|
ErrorResponse
Odpowiedź na błąd
OperationStatus
Stan operacji.
Nazwa |
Typ |
Opis |
endTime
|
string
|
Godzina zakończenia operacji.
|
error
|
ErrorResponse
|
Odpowiedź na błąd
Szczegóły błędu operacji, jeśli istnieje.
|
id
|
string
|
Identyfikator operacji.
|
name
|
string
|
Nazwa operacji.
|
startTime
|
string
|
Godzina rozpoczęcia operacji.
|
status
|
string
|
Stan operacji.
|