Abrufen von Zieltypressourcen für den angegebenen Standort.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}?api-version=2024-01-01
URI-Parameter
Name |
In |
Erforderlich |
Typ |
Beschreibung |
locationName
|
path |
True
|
string
|
Zeichenfolge, die einen Namen der Location-Ressource darstellt.
Regex pattern: ^[a-zA-Z0-9_\-\.]+$
|
subscriptionId
|
path |
True
|
string
|
GUID, die eine Azure-Abonnement-ID darstellt.
Regex pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
|
targetTypeName
|
path |
True
|
string
|
Zeichenfolge, die einen Ressourcennamen des Zieltyps darstellt.
Regex pattern: ^[a-zA-Z0-9_\-\.]+$
|
api-version
|
query |
True
|
string
|
Zeichenfolge, die die API-Version festlegt.
Regex pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}(|-preview)$
|
Antworten
Name |
Typ |
Beschreibung |
200 OK
|
targetType
|
Zieltypressource, die zurückgegeben wird, wenn die Anforderung erfolgreich war.
|
Other Status Codes
|
ErrorResponse
|
Fehlerantwort zurückgegeben, wenn die Anforderung nicht erfolgreich war.
|
Sicherheit
azure_auth
Azure Active Directory-OAuth2-Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Beschreibung |
user_impersonation
|
Identitätswechsel Ihres Benutzerkontos
|
Beispiele
Get a Target Type for westus2 location
Sample Request
GET https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent?api-version=2024-01-01
/**
* Samples for TargetTypes Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json
*/
/**
* Sample code: Get a Target Type for westus2 location.
*
* @param manager Entry point to ChaosManager.
*/
public static void getATargetTypeForWestus2Location(com.azure.resourcemanager.chaos.ChaosManager manager) {
manager.targetTypes().getWithResponse("westus2", "Microsoft-Agent", 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.chaos import ChaosManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-chaos
# USAGE
python get_target_type.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 = ChaosManagementClient(
credential=DefaultAzureCredential(),
subscription_id="6b052e15-03d3-4f17-b2e1-be7f07588291",
)
response = client.target_types.get(
location_name="westus2",
target_type_name="Microsoft-Agent",
)
print(response)
# x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.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 armchaos_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/chaos/armchaos"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e4009d2f8d3bf0271757e522c7d1c1997e193d44/specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json
func ExampleTargetTypesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armchaos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewTargetTypesClient().Get(ctx, "westus2", "Microsoft-Agent", nil)
if err != nil {
log.Fatalf("failed to finish the request: %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.TargetType = armchaos.TargetType{
// Name: to.Ptr("Microsoft-Agent"),
// Type: to.Ptr("Microsoft.Chaos/locations/targetTypes"),
// ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent"),
// Location: to.Ptr("centraluseuap"),
// Properties: &armchaos.TargetTypeProperties{
// Description: to.Ptr("A target represents Chaos Agent."),
// DisplayName: to.Ptr("Chaos Agent"),
// PropertiesSchema: to.Ptr("https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json"),
// ResourceTypes: []*string{
// to.Ptr("Microsoft.Compute/virtualMachines"),
// to.Ptr("Microsoft.Compute/virtualMachineScaleSets")},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ChaosManagementClient } = require("@azure/arm-chaos");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get a Target Type resources for given location.
*
* @summary Get a Target Type resources for given location.
* x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json
*/
async function getATargetTypeForWestus2Location() {
const subscriptionId =
process.env["CHAOS_SUBSCRIPTION_ID"] || "6b052e15-03d3-4f17-b2e1-be7f07588291";
const locationName = "westus2";
const targetTypeName = "Microsoft-Agent";
const credential = new DefaultAzureCredential();
const client = new ChaosManagementClient(credential, subscriptionId);
const result = await client.targetTypes.get(locationName, targetTypeName);
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 System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Chaos;
// Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json
// this example is just showing the usage of "TargetTypes_Get" 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://learn.microsoft.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 ChaosTargetTypeResource created on azure
// for more information of creating ChaosTargetTypeResource, please refer to the document of ChaosTargetTypeResource
string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291";
string locationName = "westus2";
string targetTypeName = "Microsoft-Agent";
ResourceIdentifier chaosTargetTypeResourceId = ChaosTargetTypeResource.CreateResourceIdentifier(subscriptionId, locationName, targetTypeName);
ChaosTargetTypeResource chaosTargetType = client.GetChaosTargetTypeResource(chaosTargetTypeResourceId);
// invoke the operation
ChaosTargetTypeResource result = await chaosTargetType.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ChaosTargetTypeData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/locations/westus2/targetTypes/Microsoft-Agent",
"type": "Microsoft.Chaos/locations/targetTypes",
"name": "Microsoft-Agent",
"location": "centraluseuap",
"properties": {
"displayName": "Chaos Agent",
"description": "A target represents Chaos Agent.",
"propertiesSchema": "https://schema.centralus.chaos-prod.azure.com/targets/Microsoft-VirtualMachine.json",
"resourceTypes": [
"Microsoft.Compute/virtualMachines",
"Microsoft.Compute/virtualMachineScaleSets"
]
}
}
Definitionen
createdByType
Der Identitätstyp, der die Ressource erstellt hat.
Name |
Typ |
Beschreibung |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorAdditionalInfo
Zusätzliche Informationen zum Ressourcenverwaltungsfehler.
Name |
Typ |
Beschreibung |
info
|
object
|
Zusätzliche Informationen.
|
type
|
string
|
Typ der zusätzlichen Informationen.
|
ErrorDetail
Die Fehlerdetails.
Name |
Typ |
Beschreibung |
additionalInfo
|
ErrorAdditionalInfo[]
|
Die zusätzlichen Fehlerinformationen.
|
code
|
string
|
Der Fehlercode.
|
details
|
ErrorDetail[]
|
Die Fehlerdetails.
|
message
|
string
|
Die Fehlermeldung.
|
target
|
string
|
Das Fehlerziel.
|
ErrorResponse
Fehlerantwort
Name |
Typ |
Beschreibung |
error
|
ErrorDetail
|
Das Fehlerobjekt.
|
systemData
Metadaten, die sich auf die Erstellung und letzte Änderung der Ressource beziehen.
Name |
Typ |
Beschreibung |
createdAt
|
string
|
Der Zeitstempel der Ressourcenerstellung (UTC).
|
createdBy
|
string
|
Die Identität, die die Ressource erstellt hat.
|
createdByType
|
createdByType
|
Der Identitätstyp, der die Ressource erstellt hat.
|
lastModifiedAt
|
string
|
Der Zeitstempel der letzten Änderung der Ressource (UTC)
|
lastModifiedBy
|
string
|
Die Identität, die die Ressource zuletzt geändert hat.
|
lastModifiedByType
|
createdByType
|
Der Identitätstyp, der die Ressource zuletzt geändert hat.
|
targetType
Modell, das eine Zieltypressource darstellt.
Name |
Typ |
Beschreibung |
id
|
string
|
Vollqualifizierte Ressourcen-ID für die Ressource. Beispiel: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
Speicherort der Zieltypressource.
|
name
|
string
|
Der Name der Ressource
|
properties.description
|
string
|
Lokalisierte Zeichenfolge der Beschreibung.
|
properties.displayName
|
string
|
Lokalisierte Zeichenfolge des Anzeigenamens.
|
properties.propertiesSchema
|
string
|
URL zum Abrufen des JSON-Schemas der Zieltypeigenschaften.
|
properties.resourceTypes
|
string[]
|
Liste der Ressourcentypen, die dieser Zieltyp erweitern kann.
|
systemData
|
systemData
|
Die Systemmetadateneigenschaften der Zieltypressource.
|
type
|
string
|
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts"
|