Freigeben über


DeploymentEnvironmentsClient.GetCatalogAsync Method

Definition

Overloads

GetCatalogAsync(String, String, RequestContext)

[Protocol Method] Gets the specified catalog within the project

GetCatalogAsync(String, String, CancellationToken)

Gets the specified catalog within the project.

GetCatalogAsync(String, String, RequestContext)

Source:
DeploymentEnvironmentsClient.cs
Source:
DeploymentEnvironmentsClient.cs

[Protocol Method] Gets the specified catalog within the project

public virtual System.Threading.Tasks.Task<Azure.Response> GetCatalogAsync (string projectName, string catalogName, Azure.RequestContext context);
abstract member GetCatalogAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetCatalogAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetCatalogAsync (projectName As String, catalogName As String, context As RequestContext) As Task(Of Response)

Parameters

projectName
String

Name of the project.

catalogName
String

Name of the catalog.

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 or catalogName is null.

projectName or catalogName 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 GetCatalogAsync 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 = await client.GetCatalogAsync("<projectName>", "<catalogName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());

This sample shows how to call GetCatalogAsync 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 = await client.GetCatalogAsync("<projectName>", "<catalogName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());

Applies to

GetCatalogAsync(String, String, CancellationToken)

Source:
DeploymentEnvironmentsClient.cs

Gets the specified catalog within the project.

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

Parameters

projectName
String

Name of the project.

catalogName
String

Name of the catalog.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName or catalogName is null.

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

Examples

This sample shows how to call GetCatalogAsync.

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

Response<DevCenterCatalog> response = await client.GetCatalogAsync("<projectName>", "<catalogName>");

This sample shows how to call GetCatalogAsync with all parameters.

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

Response<DevCenterCatalog> response = await client.GetCatalogAsync("<projectName>", "<catalogName>");

Applies to