Partager via


DevCenterClient.GetProject Method

Definition

Overloads

GetProject(String, RequestContext)

[Protocol Method] Gets a project.

GetProject(String, CancellationToken)

Gets a project.

GetProject(String, RequestContext)

Source:
DevCenterClient.cs
Source:
DevCenterClient.cs

[Protocol Method] Gets a project.

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

Parameters

projectName
String

Name of the project.

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 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 GetProject and parse the result.

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

Response response = client.GetProject("<projectName>", null);

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

This sample shows how to call GetProject with all parameters and parse the result.

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

Response response = client.GetProject("<projectName>", null);

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

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for Project:

{
  name: string, # Optional. Name of the project
  description: string, # Optional. Description of the project.
}

Applies to

GetProject(String, CancellationToken)

Source:
DevCenterClient.cs

Gets a project.

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

Parameters

projectName
String

Name of the project.

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

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

Response<DevCenterProject> response = client.GetProject("<projectName>");

This sample shows how to call GetProject with all parameters.

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

Response<DevCenterProject> response = client.GetProject("<projectName>");

Applies to