How to get low level operations contained in a configuration operation
Use REST APIs to get low level operations contained in a configuration operation. This helps to reveal some information which can help troubleshooting some issues, for example, PowerShell cmdlet parameters.
Follow the prerequisites and examples to get started with this API.
You can make API requests using the PowerShell code, C# code, Python, or any tool that supports invoking the REST API.
Prerequisites to get low level operations contained in a configuration operation
- Read the Learning journey for Citrix Virtual Apps and Desktops APIs section to ensure that you have the
bearer token
. - Get
siteid
from How to get site id API. - Get
operationid
from How to get configuration operations or How to perform an advanced search for operations APIs. - Invoke the API described in this document from a client host or from the API exploration tab to get low level operations contained in a configuration operation.
Get low level operations using any REST API tool
Learn from the following example to get low level operations contained in a configuration operation using any REST API tool.
Request
GET https://[DdcServerAddress]/cvad/manage/ConfigLog/Operations/{operationid}/LowLevelOperations HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Authorization: CWSAuth bearer=<token-from-prerequisites>
Citrix-CustomerId: loy6oujtu6a4
Citrix-InstanceId: 22ded57c-0306-47e4-b6e8-fed6252759e1
<!--NeedCopy-->
Response
HTTP/1.1 200 OK
citrix-transactionid: ba78d60e-eb03-4e15-83fb-55ee32be61be
content-Length: 457
content-Type: application/json; charset=utf-8
date: "Mon, 07 Dec 2020 16:41:33 GMT"
Server: Citrix Systems, Inc.
{
"Items": [
{
"AdminMachineIP": "",
"Details": [
{
"EndTime": "12/21/2020 : 3:21:12 PM",
"IsSuccessful": true,
"NewValue": "",
"PreviousValue": "",
"PropertyName": "",
"AddValue": "",
"RemoveValue": "",
"StartTime": "12/21/2020 : 3:21:12 PM",
"TargetName": "DataExplorer",
"TargetUid": "4",
"TargetType": "Application",
"Text": "Remove Application 'DataExplorer'"
}
],
"EndTime": "12/21/2020 : 3:21:12 PM",
"Id": "4dbf69d7-2693-4fdb-b6f4-1c2ec5e09ac8",
"IsSuccessful": true,
"OperationId": "0d96ecf1-4c73-4a0c-9476-ecbf40289d2b",
"OperationType": "ConfigurationChange",
"Parameters": [
{
"Name": "Cmdlet",
"Value": "Remove-BrokerApplication"
},
{
"Name": "Force",
"Value": "False"
}
],
"Source": "Broker SDK",
"SourceSdk": "Broker",
"StartTime": "12/21/2020 : 3:21:12 PM",
"TargetTypes": [
"Application"
],
"Text": "Remove Application 'DataExplorer'",
"User": "jack.smith@example.com"
}
]
}
<!--NeedCopy-->
Get low level operations using PowerShell
Learn from the following example to get low level operations contained in a configuration operation using any PowerShell code.
function GetLowLevelOperations {
param (
[Parameter(Mandatory=$true)]
[string] $customerid,
[Parameter(Mandatory=$true)]
[string] $siteid,
[Parameter(Mandatory=$true)]
[string] $operationid,
[Parameter(Mandatory=$true)]
[string] $bearerToken
)
$requestUri = [string]::Format("https://[DdcServerAddress]/cvad/manage/ConfigLog/Operations/{0}/LowLevelOperations", $operationid)
$headers = @{
"Accept" = "application/json";
"Authorization" = "CWSAuth Bearer=$bearerToken";
"Citrix-CustomerId" = $customerid;
"Citrix-InstanceId" = $siteid;
}
$response = Invoke-RestMethod -Uri $requestUri -Method GET -Headers $headers
return $response
}
$customerid = "n2ypkklgy6cv"
$siteid = "12f7438-bf8e-42ba-b1b3-2eb75d098f57"
$operationid = "0d96ecf1-4c73-4a0c-9476-ecbf40289d2b"
$bearerToken = "eyJ..."
$response = GetLowLevelOperations $customerid $siteid $operationid $bearerToken
<!--NeedCopy-->
Get low level operations using C# code
Learn from the following example to get low level operations contained in a configuration operation using any C# code.
public static async Task<string> GetLowLevelOperations(
string customerid,
string siteid,
string operationid,
string bearerToken)
{
var requestUri = string.Format("https://[DdcServerAddress]/cvad/manage/ConfigLog/Operations/{0}/LowLevelOperations", operationid);
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
client.DefaultRequestHeaders.Add("Citrix-CustomerId", customerid);
client.DefaultRequestHeaders.Add("Citrix-InstanceId", siteid);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("CWSAuth Bearer=" + bearerToken);
var response = await client.GetAsync(requestUri);
if (response != null)
{
var content = await response.Content.ReadAsStringAsync();
return content;
}
return null;
}
}
<!--NeedCopy-->
Get low level operations using Python
Learn from the following example to get low level operations contained in a configuration operation using Python.
import requests
def get_low_level_operations(bearerToken, customerid, siteid, operationid):
request_uri = "https://[DdcServerAddress]/cvad/manage/ConfigLog/Operations/{0}/LowLevelOperations".format(operationid)
headers = {
'Authorization': 'CWSAuth Bearer=%s' % bearerToken,
'Citrix-CustomerId': customerid,
'Citrix-InstanceId': siteid,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.get(request_uri, headers = headers)
return response.json()
<!--NeedCopy-->