你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

DeploymentEnvironmentsClient.GetEnvironmentDefinition Method

Definition

Overloads

GetEnvironmentDefinition(String, String, String, RequestContext)

[Protocol Method] Get an environment definition from a catalog.

GetEnvironmentDefinition(String, String, String, CancellationToken)

Get an environment definition from a catalog.

GetEnvironmentDefinition(String, String, String, RequestContext)

Source:
DeploymentEnvironmentsClient.cs
Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Get an environment definition from a catalog.

public virtual Azure.Response GetEnvironmentDefinition(string projectName, string catalogName, string definitionName, Azure.RequestContext context);
abstract member GetEnvironmentDefinition : string * string * string * Azure.RequestContext -> Azure.Response
override this.GetEnvironmentDefinition : string * string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetEnvironmentDefinition (projectName As String, catalogName As String, definitionName As String, context As RequestContext) As Response

Parameters

projectName
String

Name of the project.

catalogName
String

Name of the catalog.

definitionName
String

Name of the environment definition.

context
RequestContext

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

Returns

The response returned from the service.

Exceptions

projectName, catalogName or definitionName is null.

projectName, catalogName or definitionName 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 GetEnvironmentDefinition and parse the result.

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

Response response = client.GetEnvironmentDefinition("<projectName>", "<catalogName>", "<definitionName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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 GetEnvironmentDefinition 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);

Response response = client.GetEnvironmentDefinition("<projectName>", "<catalogName>", "<definitionName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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

GetEnvironmentDefinition(String, String, String, CancellationToken)

Source:
DeploymentEnvironmentsClient.cs

Get an environment definition from a catalog.

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

Parameters

projectName
String

Name of the project.

catalogName
String

Name of the catalog.

definitionName
String

Name of the environment definition.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName, catalogName or definitionName is null.

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

Examples

This sample shows how to call GetEnvironmentDefinition.

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

Response<EnvironmentDefinition> response = client.GetEnvironmentDefinition("<projectName>", "<catalogName>", "<definitionName>");

This sample shows how to call GetEnvironmentDefinition with all parameters.

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

Response<EnvironmentDefinition> response = client.GetEnvironmentDefinition("<projectName>", "<catalogName>", "<definitionName>");

Applies to