from azure.identity import DefaultAzureCredential
from azure.mgmt.dynatrace import DynatraceObservabilityMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dynatrace
# USAGE
python operations_list_maximum_set_gen.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 = DynatraceObservabilityMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.operations.list()
for item in response:
print(item)
# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MaximumSet_Gen.json
if __name__ == "__main__":
main()
package armdynatrace_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MaximumSet_Gen.json
func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdynatrace.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.OperationListResult = armdynatrace.OperationListResult{
// Value: []*armdynatrace.Operation{
// {
// Name: to.Ptr("Dynatrace.Observability/monitors/write"),
// ActionType: to.Ptr(armdynatrace.ActionTypeInternal),
// Display: &armdynatrace.OperationDisplay{
// Description: to.Ptr("Write monitors resource"),
// Operation: to.Ptr("write"),
// Provider: to.Ptr("Dynatrace.Observability"),
// Resource: to.Ptr("monitors"),
// },
// IsDataAction: to.Ptr(true),
// Origin: to.Ptr(armdynatrace.OriginUser),
// }},
// }
}
}
const { DynatraceObservability } = require("@azure/arm-dynatrace");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List the operations for Dynatrace.Observability
*
* @summary List the operations for Dynatrace.Observability
* x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MaximumSet_Gen.json
*/
async function operationsListMaximumSetGen() {
const subscriptionId =
process.env["DYNATRACE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DynatraceObservability(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.dynatrace import DynatraceObservabilityMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dynatrace
# USAGE
python operations_list_minimum_set_gen.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 = DynatraceObservabilityMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.operations.list()
for item in response:
print(item)
# x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MinimumSet_Gen.json
if __name__ == "__main__":
main()
package armdynatrace_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751f321654db00858e70649291af5c81e94611e/specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MinimumSet_Gen.json
func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdynatrace.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.OperationListResult = armdynatrace.OperationListResult{
// }
}
}
const { DynatraceObservability } = require("@azure/arm-dynatrace");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List the operations for Dynatrace.Observability
*
* @summary List the operations for Dynatrace.Observability
* x-ms-original-file: specification/dynatrace/resource-manager/Dynatrace.Observability/stable/2021-09-01/examples/Operations_List_MinimumSet_Gen.json
*/
async function operationsListMinimumSetGen() {
const subscriptionId =
process.env["DYNATRACE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DynatraceObservability(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.operations.list()) {
resArray.push(item);
}
console.log(resArray);
}
Uma lista de operações de API REST suportadas por um Provedor de Recursos do Azure. Ele contém um link de URL para obter o próximo conjunto de resultados.
O executor pretendido da operação; como no Controle de Acesso Baseado em Recursos (RBAC) e na UX de logs de auditoria. O valor padrão é "user,system"
ActionType
Enumeração
Enum. Indica o tipo de ação. "Interno" refere-se a ações que são apenas para APIs internas.
Valor
Description
Internal
Display
Object
Informações de exibição localizadas para esta operação específica.
Name
Tipo
Description
description
string
A descrição amigável curta e localizada da operação; Adequado para dicas de ferramentas e visualizações detalhadas.
operation
string
O nome amigável conciso e localizado para a operação; adequado para dropdowns. Por exemplo, "Criar ou atualizar máquina virtual", "Reiniciar máquina virtual".
provider
string
A forma amigável localizada do nome do provedor de recursos, por exemplo, "Microsoft Monitoring Insights" ou "Microsoft Compute".
resource
string
O nome amigável localizado do tipo de recurso relacionado a esta operação. Por exemplo, "Máquinas Virtuais" ou "Coleções de Agendamento de Trabalho".
ErrorAdditionalInfo
Object
O erro de gerenciamento de recursos informações adicionais.
Informações de exibição localizadas para esta operação específica.
isDataAction
boolean
Se a operação se aplica ao plano de dados. Isto é "verdadeiro" para operações de plano de dados e "falso" para operações de ARM/plano de controlo.
name
string
O nome da operação, de acordo com Resource-Based Controle de Acesso (RBAC). Exemplos: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
O executor pretendido da operação; como no Controle de Acesso Baseado em Recursos (RBAC) e na UX de logs de auditoria. O valor padrão é "user,system"
OperationListResult
Object
Uma lista de operações de API REST suportadas por um Provedor de Recursos do Azure. Ele contém um link de URL para obter o próximo conjunto de resultados.
Name
Tipo
Description
nextLink
string
URL para obter o próximo conjunto de resultados da lista de operações (se houver).