Véglegesíti a kérelem törzsében található erőforrások készletét. A véglegesítési művelet a moveState 'CommitPending' vagy 'CommitFailed' moveResources elemén aktiválódik, a sikeres befejezéskor a moveResource moveState véglegesítésre vált. Annak érdekében, hogy segítse a felhasználót a művelet előfeltételeinek eléréséhez, az ügyfél meghívhatja a műveletet a validateOnly tulajdonság igaz értékre állításával.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit?api-version=2023-08-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
moveCollectionName
|
path |
True
|
string
|
A gyűjtemény neve.
|
resourceGroupName
|
path |
True
|
string
|
Az erőforráscsoport neve.
|
subscriptionId
|
path |
True
|
string
|
Az előfizetés azonosítója.
|
api-version
|
query |
True
|
string
|
Ügyfél API-verziója.
|
Kérelem törzse
Name |
Kötelező |
Típus |
Description |
moveResources
|
True
|
string[]
|
Lekéri vagy beállítja az erőforrás-azonosítók listáját, alapértelmezés szerint elfogadja az erőforrás-azonosítók áthelyezését, kivéve, ha a bemeneti típust a moveResourceInputType tulajdonságon keresztül váltja.
|
moveResourceInputType
|
|
MoveResourceInputType
|
Meghatározza az áthelyezési erőforrás bemeneti típusát.
|
validateOnly
|
|
boolean
|
Lekéri vagy beállít egy értéket, amely jelzi, hogy a műveletnek csak az előfeltételeknek kell-e futnia.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
OperationStatus
|
OK
|
202 Accepted
|
|
Elfogadva
|
Other Status Codes
|
CloudError
|
Hibaválasz, amely leírja, hogy a művelet miért hiúsult meg.
|
Biztonság
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
felhasználói fiók megszemélyesítése
|
Példák
MoveCollections_Commit
Sample Request
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/moveCollections/movecollection1/commit?api-version=2023-08-01
{
"validateOnly": false,
"moveResources": [
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1/MoveResources/moveresource1"
]
}
import com.azure.resourcemanager.resourcemover.models.CommitRequest;
import java.util.Arrays;
/** Samples for MoveCollections Commit. */
public final class Main {
/*
* x-ms-original-file: specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2023-08-01/examples/MoveCollections_Commit.json
*/
/**
* Sample code: MoveCollections_Commit.
*
* @param manager Entry point to ResourceMoverManager.
*/
public static void moveCollectionsCommit(com.azure.resourcemanager.resourcemover.ResourceMoverManager manager) {
manager
.moveCollections()
.commit(
"rg1",
"movecollection1",
new CommitRequest()
.withValidateOnly(false)
.withMoveResources(
Arrays
.asList(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1/MoveResources/moveresource1")),
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.resourcemover import ResourceMoverServiceAPI
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resourcemover
# USAGE
python move_collections_commit.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 = ResourceMoverServiceAPI(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.move_collections.begin_commit(
resource_group_name="rg1",
move_collection_name="movecollection1",
).result()
print(response)
# x-ms-original-file: specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2023-08-01/examples/MoveCollections_Commit.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 armresourcemover_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcemover/armresourcemover"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2023-08-01/examples/MoveCollections_Commit.json
func ExampleMoveCollectionsClient_BeginCommit() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armresourcemover.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMoveCollectionsClient().BeginCommit(ctx, "rg1", "movecollection1", &armresourcemover.MoveCollectionsClientBeginCommitOptions{Body: &armresourcemover.CommitRequest{
MoveResources: []*string{
to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1/MoveResources/moveresource1")},
ValidateOnly: to.Ptr(false),
},
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armresourcemover.OperationStatus{
// Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"),
// EndTime: to.Ptr("6/17/2020 6:45:56 AM"),
// ID: to.Ptr("/subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resourceGroups/RegionMoveRG-southcentralus-southeastasia/providers/Microsoft.Migrate/MoveCollections/MoveCollection-southcentralus-southeastasia/operations/1e4193c3-206e-4916-b124-1da16175eb0e"),
// Properties: map[string]any{
// },
// StartTime: to.Ptr("6/17/2020 6:45:55 AM"),
// 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 { ResourceMoverServiceAPI } = require("@azure/arm-resourcemover");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Commits the set of resources included in the request body. The commit operation is triggered on the moveResources in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a transition to Committed. To aid the user to prerequisite the operation the client can call operation with validateOnly property set to true.
*
* @summary Commits the set of resources included in the request body. The commit operation is triggered on the moveResources in the moveState 'CommitPending' or 'CommitFailed', on a successful completion the moveResource moveState do a transition to Committed. To aid the user to prerequisite the operation the client can call operation with validateOnly property set to true.
* x-ms-original-file: specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2023-08-01/examples/MoveCollections_Commit.json
*/
async function moveCollectionsCommit() {
const subscriptionId = process.env["RESOURCEMOVER_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["RESOURCEMOVER_RESOURCE_GROUP"] || "rg1";
const moveCollectionName = "movecollection1";
const body = {
moveResources: [
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1/MoveResources/moveresource1",
],
validateOnly: false,
};
const options = { body };
const credential = new DefaultAzureCredential();
const client = new ResourceMoverServiceAPI(credential, subscriptionId);
const result = await client.moveCollections.beginCommitAndWait(
resourceGroupName,
moveCollectionName,
options
);
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
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.ResourceMover;
using Azure.ResourceManager.ResourceMover.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2023-08-01/examples/MoveCollections_Commit.json
// this example is just showing the usage of "MoveCollections_Commit" 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 MoverResourceSetResource created on azure
// for more information of creating MoverResourceSetResource, please refer to the document of MoverResourceSetResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string moverResourceSetName = "movecollection1";
ResourceIdentifier moverResourceSetResourceId = MoverResourceSetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, moverResourceSetName);
MoverResourceSetResource moverResourceSet = client.GetMoverResourceSetResource(moverResourceSetResourceId);
// invoke the operation
MoverCommitContent content = new MoverCommitContent(new ResourceIdentifier[]
{
new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1/MoveResources/moveresource1")
})
{
ValidateOnly = false,
};
ArmOperation<MoverOperationStatus> lro = await moverResourceSet.CommitAsync(WaitUntil.Completed, content: content);
MoverOperationStatus result = lro.Value;
Console.WriteLine($"Succeeded: {result}");
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
{
"id": "/subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resourceGroups/RegionMoveRG-southcentralus-southeastasia/providers/Microsoft.Migrate/MoveCollections/MoveCollection-southcentralus-southeastasia/operations/1e4193c3-206e-4916-b124-1da16175eb0e",
"name": "1e4193c3-206e-4916-b124-1da16175eb0e",
"status": "Succeeded",
"startTime": "6/17/2020 6:45:55 AM",
"endTime": "6/17/2020 6:45:56 AM",
"error": null,
"properties": {}
}
Location: https://some.endpoint.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Migrate/MoveCollections/movecollection1?api-version=2022-11-01
Definíciók
AffectedMoveResource
Az egyéni RP-művelet hibaadatai.
Name |
Típus |
Description |
id
|
string
|
Az érintett áthelyezési erőforrás azonosítója.
|
moveResources
|
AffectedMoveResource[]
|
Az érintett áthelyezési erőforrások.
|
sourceId
|
string
|
Az érintett áthelyezési erőforrás forrásazonosítója.
|
CloudError
Hibaválasz a szolgáltatástól.
CloudErrorBody
Hibaválasz a szolgáltatástól.
Name |
Típus |
Description |
code
|
string
|
A hiba azonosítója. A kódok invariánsak, és programozott módon használhatók.
|
details
|
CloudErrorBody[]
|
A hibával kapcsolatos további részletek listája.
|
message
|
string
|
A hibát leíró üzenet, amely alkalmas a felhasználói felületen való megjelenítésre.
|
target
|
string
|
Az adott hiba célja. Például a hibás tulajdonság neve.
|
CommitRequest
Meghatározza a véglegesítési művelet kéréstörzsét.
Name |
Típus |
Description |
moveResourceInputType
|
MoveResourceInputType
|
Meghatározza az áthelyezési erőforrás bemeneti típusát.
|
moveResources
|
string[]
|
Lekéri vagy beállítja az erőforrás-azonosítók listáját, alapértelmezés szerint elfogadja az erőforrás-azonosítók áthelyezését, kivéve, ha a bemeneti típust a moveResourceInputType tulajdonságon keresztül váltja.
|
validateOnly
|
boolean
|
Lekéri vagy beállít egy értéket, amely jelzi, hogy a műveletnek csak az előfeltételeknek kell-e futnia.
|
MoveErrorInfo
Az áthelyezési egyéni hibaadatok.
Meghatározza az áthelyezési erőforrás bemeneti típusát.
Name |
Típus |
Description |
MoveResourceId
|
string
|
|
MoveResourceSourceId
|
string
|
|
OperationErrorAdditionalInfo
A művelet hibaadatai.
Name |
Típus |
Description |
info
|
MoveErrorInfo
|
A művelet hibaadatai.
|
type
|
string
|
A hiba típusa.
|
OperationStatus
A művelet állapota REST-erőforrás.
Name |
Típus |
Description |
endTime
|
string
|
Befejezés időpontja.
|
error
|
OperationStatusError
|
Hiba történt a művelet összes hibaadatainak megadásával.
|
id
|
string
|
Erőforrás-azonosító.
|
name
|
string
|
A művelet neve.
|
properties
|
OperationStatusProperties
|
Egyéni adatok.
|
startTime
|
string
|
Kezdés időpontja.
|
status
|
string
|
A művelet állapota. Az ARM arra számít, hogy a terminál állapota a Sikeres/Sikertelen/Megszakított állapotú lesz. Minden más érték azt jelenti, hogy a művelet továbbra is fut.
|
OperationStatusError
Osztály a művelet állapothibáihoz.
OperationStatusProperties
A művelet eredménytulajdonságainak osztálya.