Freigeben über


DeploymentEnvironmentsClient.GetEnvironmentDefinitionsAsync Method

Definition

Overloads

GetEnvironmentDefinitionsAsync(String, RequestContext)

[Protocol Method] Lists all environment definitions available for a project.

GetEnvironmentDefinitionsAsync(String, CancellationToken)

Lists all environment definitions available for a project.

GetEnvironmentDefinitionsAsync(String, Nullable<Int32>, RequestContext)

[Protocol Method] Lists all environment definitions available for a project.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.

GetEnvironmentDefinitionsAsync(String, RequestContext)

Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Lists all environment definitions available for a project.

public virtual Azure.AsyncPageable<BinaryData> GetEnvironmentDefinitionsAsync (string projectName, Azure.RequestContext context);
abstract member GetEnvironmentDefinitionsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetEnvironmentDefinitionsAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetEnvironmentDefinitionsAsync (projectName As String, context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

projectName is null.

projectName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetEnvironmentDefinitionsAsync and parse the result.

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.GetEnvironmentDefinitionsAsync("<projectName>", 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());
}

This sample shows how to call GetEnvironmentDefinitionsAsync with all parameters and parse the result.

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.GetEnvironmentDefinitionsAsync("<projectName>", 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());
}

Applies to

GetEnvironmentDefinitionsAsync(String, CancellationToken)

Source:
DeploymentEnvironmentsClient.cs

Lists all environment definitions available for a project.

public virtual Azure.AsyncPageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition> GetEnvironmentDefinitionsAsync (string projectName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnvironmentDefinitionsAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition>
override this.GetEnvironmentDefinitionsAsync : string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition>
Public Overridable Function GetEnvironmentDefinitionsAsync (projectName As String, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of EnvironmentDefinition)

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName is null.

projectName is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetEnvironmentDefinitionsAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);

await foreach (EnvironmentDefinition item in client.GetEnvironmentDefinitionsAsync("<projectName>"))
{
}

This sample shows how to call GetEnvironmentDefinitionsAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);

await foreach (EnvironmentDefinition item in client.GetEnvironmentDefinitionsAsync("<projectName>"))
{
}

Applies to

GetEnvironmentDefinitionsAsync(String, Nullable<Int32>, RequestContext)

Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Lists all environment definitions available for a project.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.AsyncPageable<BinaryData> GetEnvironmentDefinitionsAsync (string projectName, int? maxCount, Azure.RequestContext context);
abstract member GetEnvironmentDefinitionsAsync : string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetEnvironmentDefinitionsAsync : string * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetEnvironmentDefinitionsAsync (projectName As String, maxCount As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

projectName
String

The DevCenter Project upon which to execute operations.

maxCount
Nullable<Int32>

The maximum number of resources to return from the operation. Example: 'top=10'.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

projectName is null.

projectName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetEnvironmentDefinitionsAsync and parse the result.

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.GetEnvironmentDefinitionsAsync("<projectName>", 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());
}

This sample shows how to call GetEnvironmentDefinitionsAsync with all parameters and parse the result.

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.GetEnvironmentDefinitionsAsync("<projectName>", 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());
}

Applies to