DeploymentEnvironmentsClient.GetEnvironmentDefinitionsByCatalogAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
[Método Protocol] Enumera todas las definiciones de entorno disponibles en un catálogo.
- Este método de protocolo permite la creación explícita de la solicitud y el procesamiento de la respuesta para escenarios avanzados.
public virtual Azure.AsyncPageable<BinaryData> GetEnvironmentDefinitionsByCatalogAsync (string projectName, string catalogName, int? maxCount, Azure.RequestContext context);
abstract member GetEnvironmentDefinitionsByCatalogAsync : string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetEnvironmentDefinitionsByCatalogAsync : string * string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetEnvironmentDefinitionsByCatalogAsync (projectName As String, catalogName As String, maxCount As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parámetros
- projectName
- String
Proyecto de DevCenter en el que se van a ejecutar las operaciones.
- catalogName
- String
Nombre del catálogo.
Número máximo de recursos que se van a devolver de la operación. Ejemplo: 'top=10'.
- context
- RequestContext
Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.
Devoluciones
del AsyncPageable<T> servicio que contiene una lista de BinaryData objetos. Los detalles del esquema del cuerpo de cada elemento de la colección se encuentran en la sección Comentarios a continuación.
Excepciones
projectName
o catalogName
es null.
projectName
o catalogName
es una cadena vacía y se espera que no esté vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a GetEnvironmentDefinitionsByCatalogAsync y analizar el resultado.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentDefinitionsByCatalogAsync("<projectName>", "<catalogName>", null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("catalogName").ToString());
}
En este ejemplo se muestra cómo llamar a GetEnvironmentDefinitionsByCatalogAsync con todos los parámetros y analizar el resultado.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
await foreach (BinaryData item in client.GetEnvironmentDefinitionsByCatalogAsync("<projectName>", "<catalogName>", 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("catalogName").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("default").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("readOnly").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("required").ToString());
Console.WriteLine(result.GetProperty("parameters")[0].GetProperty("allowed")[0].ToString());
Console.WriteLine(result.GetProperty("parametersSchema").ToString());
Console.WriteLine(result.GetProperty("templatePath").ToString());
}
Se aplica a
Azure SDK for .NET