6.0 Step 3: Discover a Windows Source

This example shows how to discover a Windows source. Look at the API reference documentation under Sources > POST to understand what parameters to include with the request body.

Method: POST

https://10.10.10.143/MigrateApi/2019.8/sources
{
    "host": "10.10.11.12",
    "domain": "c",
    "username": "Administrator",
    "password": "Password1",
    "type": "AddWindowsSource",
}

Here is the data that the POST method returned. The response provides a link to an operations resource that you can query to see when the operation finishes.

Response: Data returned from POST

{
    "completedSynchronously": false,
    "operation": {
        "href": "https://10.10.10.143/MigrateApi/2019.8/operations/8bf13a70-91d1-48b6-b498-aa6400e504e8",
        "rel": "self",
        "methods": [
            "GET"
        ]
    },
    "resource": null
}

If you click the provided operations resource link, the following response shows the operation data that is returned after the discovery is complete. The "status" field at the top level is "success".

Method: GET

https://10.10.10.143/MigrateApi/2019.8/operations/8bf13a70-91d1-48b6-b498-aa6400e504e8

Response: Data returned from GET

{
    "operationType": "RunningDiscovery",
    "subOperations": [
        {
            "name": "DiscoverSourceMachine",
            "progress": 100,
            "subOperations": [
                {
                    "name": "DiscoverServerDetails",
                    "progress": 100,
                    "subOperations": [
                        {
                            "name": "GatherMachineOrContainerData",
                            "progress": 100,
                            "subOperations": null,
                            "startedAt": "2019-06-06T19:54:36.45",
                            "finishedAt": "2019-06-06T19:56:01.263",
                            "status": "success",
                            "links": []
                        }
                    ],
                    "startedAt": "2019-06-06T19:54:14.56",
                    "finishedAt": "2019-06-06T19:56:24",
                    "status": "success",
                    "links": []
                }
            ],
            "startedAt": "2019-06-06T19:53:50",
            "finishedAt": "2019-06-06T19:56:29",
            "status": "success",
            "links": []
        }
    ],
    "operationResults": [],
    "volumesTransferStatistic": null,
    "startedAt": "2019-06-06T19:53:49",
    "finishedAt": "2019-06-06T19:56:44",
    "status": "success",
    "links": [
        {
            "href": "https://10.10.10.143/MigrateApi/2019.8/operations/8bf13a70-91d1-48b6-b498-aa6400e504e8",
            "rel": "self",
            "methods": [
                "GET"
            ]
        }
    ]
}