DeploymentEnvironmentsClient.GetCatalogAsync 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
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)
[Protocol Method] Gets the specified catalog within the project
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetCatalogAsync(String, String, CancellationToken) convenience overload with strongly typed models first.
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)
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
Azure SDK for .NET