DeploymentEnvironmentsClient.GetEnvironmentTypes Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetEnvironmentTypes(String, Nullable<Int32>, RequestContext) |
[Protocol Method] Lists all environment types configured for a project.
|
GetEnvironmentTypes(String, RequestContext) |
[Protocol Method] Lists all environment types configured for a project.
|
GetEnvironmentTypes(String, CancellationToken) |
Lists all environment types configured for a project. |
GetEnvironmentTypes(String, Nullable<Int32>, RequestContext)
[Protocol Method] Lists all environment types configured 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> GetEnvironmentTypes (string projectName, int? maxCount, Azure.RequestContext context);
abstract member GetEnvironmentTypes : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetEnvironmentTypes : string * Nullable<int> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetEnvironmentTypes (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.
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 GetEnvironmentTypes 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.GetEnvironmentTypes("<projectName>", null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
This sample shows how to call GetEnvironmentTypes 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.GetEnvironmentTypes("<projectName>", 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
Applies to
GetEnvironmentTypes(String, RequestContext)
[Protocol Method] Lists all environment types configured for a project.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetEnvironmentTypes(String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Pageable<BinaryData> GetEnvironmentTypes (string projectName, Azure.RequestContext context);
abstract member GetEnvironmentTypes : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetEnvironmentTypes : string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetEnvironmentTypes (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 GetEnvironmentTypes 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.GetEnvironmentTypes("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
This sample shows how to call GetEnvironmentTypes 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.GetEnvironmentTypes("<projectName>", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("deploymentTargetId").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
}
Applies to
GetEnvironmentTypes(String, CancellationToken)
Lists all environment types configured for a project.
public virtual Azure.Pageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType> GetEnvironmentTypes (string projectName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetEnvironmentTypes : string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType>
override this.GetEnvironmentTypes : string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Developer.DevCenter.Models.DevCenterEnvironmentType>
Public Overridable Function GetEnvironmentTypes (projectName As String, Optional cancellationToken As CancellationToken = Nothing) As Pageable(Of DevCenterEnvironmentType)
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 GetEnvironmentTypes.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
foreach (DevCenterEnvironmentType item in client.GetEnvironmentTypes("<projectName>"))
{
}
This sample shows how to call GetEnvironmentTypes with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeploymentEnvironmentsClient client = new DeploymentEnvironmentsClient(endpoint, credential);
foreach (DevCenterEnvironmentType item in client.GetEnvironmentTypes("<projectName>"))
{
}