Entity.GetClassification 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
GetClassification(String, String, CancellationToken) |
Get classification for a given entity represented by a GUID. |
GetClassification(String, String, RequestContext) |
[Protocol Method] Get classification for a given entity represented by a GUID.
|
GetClassification(String, String, CancellationToken)
- Source:
- Entity.cs
Get classification for a given entity represented by a GUID.
public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification> GetClassification (string guid, string classificationName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClassification : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification>
override this.GetClassification : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification>
Public Overridable Function GetClassification (guid As String, classificationName As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasClassification)
Parameters
- guid
- String
The globally unique identifier of the entity.
- classificationName
- String
The name of the classification.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
guid
or classificationName
is null.
guid
or classificationName
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call GetClassification.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response<AtlasClassification> response = client.GetClassification("<guid>", "<classificationName>");
This sample shows how to call GetClassification with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response<AtlasClassification> response = client.GetClassification("<guid>", "<classificationName>");
Applies to
GetClassification(String, String, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Get classification for a given entity represented by a GUID.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetClassification(String, String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetClassification (string guid, string classificationName, Azure.RequestContext context);
abstract member GetClassification : string * string * Azure.RequestContext -> Azure.Response
override this.GetClassification : string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetClassification (guid As String, classificationName As String, context As RequestContext) As Response
Parameters
- guid
- String
The globally unique identifier of the entity.
- classificationName
- String
The name of the classification.
- 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
guid
or classificationName
is null.
guid
or classificationName
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 GetClassification and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response response = client.GetClassification("<guid>", "<classificationName>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetClassification with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response response = client.GetClassification("<guid>", "<classificationName>", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Applies to
Azure SDK for .NET