POST https://management.azure.com/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.PowerBIDedicated/capacities/azsdktest/suspend?api-version=2021-01-01
/**
* Samples for Capacities Suspend.
*/
public final class Main {
/*
* x-ms-original-file: 2021-01-01/suspendCapacity.json
*/
/**
* Sample code: Suspend capacity.
*
* @param manager Entry point to PowerBIDedicatedManager.
*/
public static void suspendCapacity(com.azure.resourcemanager.powerbidedicated.PowerBIDedicatedManager manager) {
manager.capacities().suspend("TestRG", "azsdktest", 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.powerbidedicated import PowerBIDedicatedMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-powerbidedicated
# USAGE
python suspend_capacity.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 = PowerBIDedicatedMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.capacities.begin_suspend(
resource_group_name="TestRG",
dedicated_capacity_name="azsdktest",
).result()
# x-ms-original-file: 2021-01-01/suspendCapacity.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 armpowerbidedicated_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/powerbidedicated/armpowerbidedicated/v2"
)
// Generated from example definition: 2021-01-01/suspendCapacity.json
func ExampleCapacitiesClient_BeginSuspend() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpowerbidedicated.NewClientFactory("613192d7-503f-477a-9cfe-4efc3ee2bd60", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCapacitiesClient().BeginSuspend(ctx, "TestRG", "azsdktest", nil)
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 poll 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 = armpowerbidedicated.CapacitiesClientSuspendResponse{
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PowerBIDedicated } = require("@azure/arm-powerbidedicated");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to suspends operation of the specified dedicated capacity instance.
*
* @summary suspends operation of the specified dedicated capacity instance.
* x-ms-original-file: 2021-01-01/suspendCapacity.json
*/
async function suspendCapacity() {
const credential = new DefaultAzureCredential();
const subscriptionId = "613192d7-503f-477a-9cfe-4efc3ee2bd60";
const client = new PowerBIDedicated(credential, subscriptionId);
await client.capacities.suspend("TestRG", "azsdktest");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue