Share via


DeploymentEnvironmentsClient.GetAllEnvironments Method

Definition

Overloads

GetAllEnvironments(String, RequestContext)

[Protocol Method] Lists the environments for a project.

GetAllEnvironments(String, CancellationToken)

Lists the environments for a project.

GetAllEnvironments(String, Nullable<Int32>, RequestContext)

[Protocol Method] Lists the environments for a project.

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

GetAllEnvironments(String, RequestContext)

Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Lists the environments for a project.

public virtual Azure.Pageable<BinaryData> GetAllEnvironments (string projectName, Azure.RequestContext context);
abstract member GetAllEnvironments : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetAllEnvironments : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetAllEnvironments (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 GetAllEnvironments 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.GetAllEnvironments("<projectName>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("environmentType").ToString());
    Console.WriteLine(result.GetProperty("catalogName").ToString());
    Console.WriteLine(result.GetProperty("environmentDefinitionName").ToString());
}

This sample shows how to call GetAllEnvironments 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.GetAllEnvironments("<projectName>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("parameters").GetProperty("<key>").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("environmentType").ToString());
    Console.WriteLine(result.GetProperty("user").ToString());
    Console.WriteLine(result.GetProperty("provisioningState").ToString());
    Console.WriteLine(result.GetProperty("resourceGroupId").ToString());
    Console.WriteLine(result.GetProperty("catalogName").ToString());
    Console.WriteLine(result.GetProperty("environmentDefinitionName").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
}

Applies to

GetAllEnvironments(String, CancellationToken)

Source:
DeploymentEnvironmentsClient.cs

Lists the environments for a project.

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

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 GetAllEnvironments.

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

foreach (DevCenterEnvironment item in client.GetAllEnvironments("<projectName>"))
{
}

This sample shows how to call GetAllEnvironments with all parameters.

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

foreach (DevCenterEnvironment item in client.GetAllEnvironments("<projectName>"))
{
}

Applies to

GetAllEnvironments(String, Nullable<Int32>, RequestContext)

Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Lists the environments 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> GetAllEnvironments (string projectName, int? maxCount, Azure.RequestContext context);
abstract member GetAllEnvironments : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetAllEnvironments : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetAllEnvironments (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 GetAllEnvironments 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.GetAllEnvironments("<projectName>", null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("environmentType").ToString());
    Console.WriteLine(result.GetProperty("catalogName").ToString());
    Console.WriteLine(result.GetProperty("environmentDefinitionName").ToString());
}

This sample shows how to call GetAllEnvironments 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.GetAllEnvironments("<projectName>", 1234, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("parameters").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("environmentType").ToString());
    Console.WriteLine(result.GetProperty("user").ToString());
    Console.WriteLine(result.GetProperty("provisioningState").ToString());
    Console.WriteLine(result.GetProperty("resourceGroupId").ToString());
    Console.WriteLine(result.GetProperty("catalogName").ToString());
    Console.WriteLine(result.GetProperty("environmentDefinitionName").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
    Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
}

Applies to