Wyświetlanie listy operacji dla danego przypisania strategii w ramach subskrypcji lub grupy zarządzania.
GET https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/assignmentOperations?api-version=2018-11-01-preview
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
assignmentName
|
path |
True
|
string
|
Nazwa przypisania strategii.
|
resourceScope
|
path |
True
|
string
|
Zakres zasobu. Prawidłowe zakresy to: grupa zarządzania (format: "/providers/Microsoft.Management/managementGroups/{managementGroup}"), subskrypcja (format: "/subscriptions/{subscriptionId}").
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API klienta.
|
Odpowiedzi
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
Assignment at management group scope
Sample Request
GET https://management.azure.com/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPAssignment/BlueprintAssignmentOperation_List.json
func ExampleAssignmentOperationsClient_NewListPager_assignmentAtManagementGroupScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAssignmentOperationsClient().NewListPager("managementGroups/ContosoOnlineGroup", "assignSimpleBlueprint", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.AssignmentOperationList = armblueprint.AssignmentOperationList{
// Value: []*armblueprint.AssignmentOperation{
// {
// Name: to.Ptr("fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Type: to.Ptr("microsoft.blueprint/blueprintAssignments/operations"),
// ID: to.Ptr("/managementGroups/ContosoOnlineGroup/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Properties: &armblueprint.AssignmentOperationProperties{
// AssignmentState: to.Ptr("succeed"),
// BlueprintVersion: to.Ptr("v20181101"),
// Deployments: []*armblueprint.AssignmentDeploymentJob{
// {
// Action: to.Ptr("put"),
// History: []*armblueprint.AssignmentDeploymentJobResult{
// {
// Error: &armblueprint.AzureResourceManagerError{
// Code: to.Ptr("dummy"),
// Message: to.Ptr("dummy"),
// },
// }},
// JobState: to.Ptr("succeeded"),
// Kind: to.Ptr("azureResource"),
// RequestURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e"),
// Result: &armblueprint.AssignmentDeploymentJobResult{
// Resources: []*armblueprint.AssignmentJobCreatedResource{
// {
// Name: to.Ptr("foobar"),
// Type: to.Ptr("foo/bar"),
// ID: to.Ptr("blabla"),
// }},
// },
// }},
// TimeCreated: to.Ptr("2018-11-13T15:19:45-08:00"),
// TimeFinished: to.Ptr("2018-11-13T15:26:02-08:00"),
// TimeStarted: to.Ptr("2018-11-13T15:21:49-08:00"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPAssignment/BlueprintAssignmentOperation_List.json
// this example is just showing the usage of "AssignmentOperations_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AssignmentResource created on azure
// for more information of creating AssignmentResource, please refer to the document of AssignmentResource
string resourceScope = "managementGroups/ContosoOnlineGroup";
string assignmentName = "assignSimpleBlueprint";
ResourceIdentifier assignmentResourceId = AssignmentResource.CreateResourceIdentifier(resourceScope, assignmentName);
AssignmentResource assignment = client.GetAssignmentResource(assignmentResourceId);
// get the collection of this AssignmentOperationResource
AssignmentOperationCollection collection = assignment.GetAssignmentOperations();
// invoke the operation and iterate over the result
await foreach (AssignmentOperationResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
AssignmentOperationData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/managementGroups/ContosoOnlineGroup/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
"blueprintVersion": "v20181101",
"assignmentState": "succeed",
"timeCreated": "2018-11-13T15:19:45-08:00",
"timeStarted": "2018-11-13T15:21:49-08:00",
"timeFinished": "2018-11-13T15:26:02-08:00",
"deployments": [
{
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
"id": "blabla",
"name": "foobar",
"type": "foo/bar"
}
]
},
"history": [
{
"error": {
"code": "dummy",
"message": "dummy"
}
}
]
}
]
}
}
],
"nextLink": null
}
Assignment at subscription scope
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPAssignment/BlueprintAssignmentOperation_List.json
func ExampleAssignmentOperationsClient_NewListPager_assignmentAtSubscriptionScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAssignmentOperationsClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", "assignSimpleBlueprint", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.AssignmentOperationList = armblueprint.AssignmentOperationList{
// Value: []*armblueprint.AssignmentOperation{
// {
// Name: to.Ptr("fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Type: to.Ptr("microsoft.blueprint/blueprintAssignments/operations"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"),
// Properties: &armblueprint.AssignmentOperationProperties{
// AssignmentState: to.Ptr("succeed"),
// BlueprintVersion: to.Ptr("v20181101"),
// Deployments: []*armblueprint.AssignmentDeploymentJob{
// {
// Action: to.Ptr("put"),
// History: []*armblueprint.AssignmentDeploymentJobResult{
// {
// Error: &armblueprint.AzureResourceManagerError{
// Code: to.Ptr("dummy"),
// Message: to.Ptr("dummy"),
// },
// }},
// JobState: to.Ptr("succeeded"),
// Kind: to.Ptr("azureResource"),
// RequestURI: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e"),
// Result: &armblueprint.AssignmentDeploymentJobResult{
// Resources: []*armblueprint.AssignmentJobCreatedResource{
// {
// Name: to.Ptr("foobar"),
// Type: to.Ptr("foo/bar"),
// ID: to.Ptr("blabla"),
// }},
// },
// }},
// TimeCreated: to.Ptr("2018-11-13T15:19:45-08:00"),
// TimeFinished: to.Ptr("2018-11-13T15:26:02-08:00"),
// TimeStarted: to.Ptr("2018-11-13T15:21:49-08:00"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPAssignment/BlueprintAssignmentOperation_List.json
// this example is just showing the usage of "AssignmentOperations_List" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AssignmentResource created on azure
// for more information of creating AssignmentResource, please refer to the document of AssignmentResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string assignmentName = "assignSimpleBlueprint";
ResourceIdentifier assignmentResourceId = AssignmentResource.CreateResourceIdentifier(resourceScope, assignmentName);
AssignmentResource assignment = client.GetAssignmentResource(assignmentResourceId);
// get the collection of this AssignmentOperationResource
AssignmentOperationCollection collection = assignment.GetAssignmentOperations();
// invoke the operation and iterate over the result
await foreach (AssignmentOperationResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
AssignmentOperationData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
"blueprintVersion": "v20181101",
"assignmentState": "succeed",
"timeCreated": "2018-11-13T15:19:45-08:00",
"timeStarted": "2018-11-13T15:21:49-08:00",
"timeFinished": "2018-11-13T15:26:02-08:00",
"deployments": [
{
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
"id": "blabla",
"name": "foobar",
"type": "foo/bar"
}
]
},
"history": [
{
"error": {
"code": "dummy",
"message": "dummy"
}
}
]
}
]
}
}
],
"nextLink": null
}
Definicje
AssignmentDeploymentJob
Reprezentuje pojedyncze zadanie w danej operacji przypisania strategii.
Nazwa |
Typ |
Opis |
action
|
string
|
Nazwa akcji wykonanej w tym zadaniu.
|
history
|
AssignmentDeploymentJobResult[]
|
Wynik tego zadania wdrożenia dla każdego ponawiania próby.
|
jobId
|
string
|
Identyfikator tego zadania.
|
jobState
|
string
|
Stan tego zadania.
|
kind
|
string
|
Rodzaj pracy.
|
requestUri
|
string
|
Odwołanie do identyfikatora zasobu zadania wdrożenia.
|
result
|
AssignmentDeploymentJobResult
|
Wynik zadania wdrożenia.
|
AssignmentDeploymentJobResult
Wynik każdego pojedynczego wdrożenia w przypisaniu strategii.
AssignmentJobCreatedResource
Zasób platformy Azure utworzony na podstawie zadania wdrożenia.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator ciągu używany do lokalizowania dowolnego zasobu na platformie Azure.
|
name
|
string
|
Nazwa tego zasobu.
|
properties
|
object
|
Dodatkowe właściwości w słowniku.
|
type
|
string
|
Typ tego zasobu.
|
AssignmentOperation
Reprezentuje szczegóły wdrożenia bazowego dla każdej aktualizacji przypisania strategii.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator ciągu używany do lokalizowania dowolnego zasobu na platformie Azure.
|
name
|
string
|
Nazwa tego zasobu.
|
properties.assignmentState
|
string
|
Stan tej operacji przypisania strategii.
|
properties.blueprintVersion
|
string
|
Opublikowana wersja definicji strategii używanej do operacji przypisania strategii.
|
properties.deployments
|
AssignmentDeploymentJob[]
|
Lista zadań w tej operacji przypisania strategii.
|
properties.timeCreated
|
string
|
Utwórz godzinę tej operacji przypisania strategii.
|
properties.timeFinished
|
string
|
Zakończ czas ogólnych wdrożeń bazowych.
|
properties.timeStarted
|
string
|
Godzina rozpoczęcia bazowego wdrożenia.
|
type
|
string
|
Typ tego zasobu.
|
AssignmentOperationList
Lista przypisaniaOperation.
Nazwa |
Typ |
Opis |
nextLink
|
string
|
Link do następnej strony wyników.
|
value
|
AssignmentOperation[]
|
Lista przypisaniaOperation.
|
AzureResourceManagerError
Kod błędu i komunikat
Nazwa |
Typ |
Opis |
code
|
string
|
Kod błędu.
|
message
|
string
|
Komunikat o błędzie.
|
CloudError
Nazwa |
Typ |
Opis |
error
|
ErrorResponse
|
Odpowiedź na błąd
Typowa odpowiedź na błąd dla wszystkich interfejsów API usługi Azure Resource Manager zwraca szczegóły błędu dla operacji, które zakończyły się niepowodzeniem. (Jest to również zgodne z formatem odpowiedzi oData).
|
ErrorAdditionalInfo
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorResponse
Odpowiedź na błąd
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
ErrorResponse[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|