POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/table1_SRCH/cancelSearch?api-version=2022-10-01
/** Samples for Tables CancelSearch. */
public final class Main {
/*
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesSearchCancel.json
*/
/**
* Sample code: TablesSearchCancel.
*
* @param manager Entry point to LogAnalyticsManager.
*/
public static void tablesSearchCancel(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
manager
.tables()
.cancelSearchWithResponse(
"oiautorest6685", "oiautorest6685", "table1_SRCH", 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 tables_search_cancel.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="00000000-0000-0000-0000-00000000000",
)
response = client.tables.cancel_search(
resource_group_name="oiautorest6685",
workspace_name="oiautorest6685",
table_name="table1_SRCH",
)
print(response)
# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesSearchCancel.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
const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Cancel a log analytics workspace search results table query run.
*
* @summary Cancel a log analytics workspace search results table query run.
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesSearchCancel.json
*/
async function tablesSearchCancel() {
const subscriptionId =
process.env["OPERATIONALINSIGHTS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-00000000000";
const resourceGroupName = process.env["OPERATIONALINSIGHTS_RESOURCE_GROUP"] || "oiautorest6685";
const workspaceName = "oiautorest6685";
const tableName = "table1_SRCH";
const credential = new DefaultAzureCredential();
const client = new OperationalInsightsManagementClient(credential, subscriptionId);
const result = await client.tables.cancelSearch(resourceGroupName, workspaceName, tableName);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.OperationalInsights.Models;
using Azure.ResourceManager.OperationalInsights;
// Generated from example definition: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesSearchCancel.json
// this example is just showing the usage of "Tables_CancelSearch" 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://video2.skills-academy.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 OperationalInsightsTableResource created on azure
// for more information of creating OperationalInsightsTableResource, please refer to the document of OperationalInsightsTableResource
string subscriptionId = "00000000-0000-0000-0000-00000000000";
string resourceGroupName = "oiautorest6685";
string workspaceName = "oiautorest6685";
string tableName = "table1_SRCH";
ResourceIdentifier operationalInsightsTableResourceId = OperationalInsightsTableResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, tableName);
OperationalInsightsTableResource operationalInsightsTable = client.GetOperationalInsightsTableResource(operationalInsightsTableResourceId);
// invoke the operation
await operationalInsightsTable.CancelSearchAsync();
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