AssetsClient.GetAssetAsync(String, String, RequestContext) 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.
Get asset in a sentShare.
public virtual System.Threading.Tasks.Task<Azure.Response> GetAssetAsync (string sentShareName, string assetName, Azure.RequestContext context = default);
abstract member GetAssetAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetAssetAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetAssetAsync (sentShareName As String, assetName As String, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- sentShareName
- String
The name of the sent share.
- assetName
- String
The name of the asset.
- 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. Details of the response body schema are in the Remarks section below.
Exceptions
sentShareName
or assetName
is null.
sentShareName
or assetName
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 GetAssetAsync with required parameters and parse the result.
var credential = new DefaultAzureCredential();
var client = new AssetsClient("<https://my-service.azure.com>", credential);
Response response = await client.GetAssetAsync("<sentShareName>", "<assetName>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
Console.WriteLine(result.GetProperty("kind").ToString());
Remarks
Get an asset on a sent share
Below is the JSON schema for the response payload.
Response Body:
This method takes one of the JSON objects below as a payload. Please select a JSON object to view the schema for this.
AdlsGen2AccountAsset
Schema forAdlsGen2AccountAsset
:
{
kind: AdlsGen2Account, # Required. The types of asset.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
location: string, # Optional. Location of the adls gen2 storage account.
paths: [
{
containerName: string, # Required. Gets or sets the container name.
receiverPath: string, # Optional. Gets or sets the path on the receiver side where the asset is to be mapped.
senderPath: string, # Optional. Gets or sets the path to file/folder within the container to be shared.
}
], # Required. A list of adls gen2 storage account paths to be shared.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
receiverAssetName: string, # Required. Name of the asset for the receiver.
storageAccountResourceId: string, # Required. Resource id of the adls gen2 storage account.
}, # Required. Adls gen 2 account asset properties
}
~+ 1 more JSON objects
BlobAccountAsset
Schema forBlobAccountAsset
:
{
kind: BlobAccount, # Required. The types of asset.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
location: string, # Optional. Location of the blob storage account.
paths: [
{
containerName: string, # Required. Gets or sets the container name.
receiverPath: string, # Optional. Gets or sets the path on the receiver side where the asset is to be mapped.
senderPath: string, # Optional. Gets or sets the path to file/folder within the container to be shared.
}
], # Required. A list of blob storage account paths to be shared.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
receiverAssetName: string, # Required. Name of the asset for the receiver.
storageAccountResourceId: string, # Required. Resource id of the blob storage account.
}, # Required. Blob storage account asset properties
}