Share via


DeploymentEnvironmentsClient.GetEnvironmentDefinitions Method

Definition

Overloads

GetEnvironmentDefinitions(String, RequestContext)

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

GetEnvironmentDefinitions(String, CancellationToken)

Lists all environment definitions available for a project.

GetEnvironmentDefinitions(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.

GetEnvironmentDefinitions(String, RequestContext)

Source:
DeploymentEnvironmentsClient.cs

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

public virtual Azure.Pageable<BinaryData> GetEnvironmentDefinitions (string projectName, Azure.RequestContext context);
abstract member GetEnvironmentDefinitions : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetEnvironmentDefinitions : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetEnvironmentDefinitions (projectName As String, context As RequestContext) As Pageable(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 Pageable<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 GetEnvironmentDefinitions and parse the result.

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

foreach (BinaryData item in client.GetEnvironmentDefinitions("<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 GetEnvironmentDefinitions 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);

foreach (BinaryData item in client.GetEnvironmentDefinitions("<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

GetEnvironmentDefinitions(String, CancellationToken)

Source:
DeploymentEnvironmentsClient.cs

Lists all environment definitions available for a project.

public virtual Azure.Pageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition> GetEnvironmentDefinitions (string projectName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnvironmentDefinitions : string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition>
override this.GetEnvironmentDefinitions : string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Developer.DevCenter.Models.EnvironmentDefinition>
Public Overridable Function GetEnvironmentDefinitions (projectName As String, Optional cancellationToken As CancellationToken = Nothing) As Pageable(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 GetEnvironmentDefinitions.

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

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

This sample shows how to call GetEnvironmentDefinitions with all parameters.

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

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

Applies to

GetEnvironmentDefinitions(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.Pageable<BinaryData> GetEnvironmentDefinitions (string projectName, int? maxCount, Azure.RequestContext context);
abstract member GetEnvironmentDefinitions : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetEnvironmentDefinitions : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetEnvironmentDefinitions (projectName As String, maxCount As Nullable(Of Integer), context As RequestContext) As Pageable(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 Pageable<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 GetEnvironmentDefinitions and parse the result.

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

foreach (BinaryData item in client.GetEnvironmentDefinitions("<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 GetEnvironmentDefinitions 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);

foreach (BinaryData item in client.GetEnvironmentDefinitions("<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