次の方法で共有


AssetsClient.GetAssetAsync(String, String, RequestContext) メソッド

定義

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)

パラメーター

sentShareName
String

送信された共有の名前。

assetName
String

資産の名前。

context
RequestContext

要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。

戻り値

サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。

例外

sentShareName または assetName が null です。

sentShareName または assetName が空の文字列であり、空でないと想定されていました。

サービスから成功以外の状態コードが返されました。

このサンプルでは、必要なパラメーターを使用して GetAssetAsync を呼び出し、結果を解析する方法を示します。

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());

注釈

送信された共有の資産を取得する

応答ペイロードの JSON スキーマを次に示します。

応答本文:

このメソッドは、以下のいずれかの JSON オブジェクトをペイロードとして受け取ります。 JSON オブジェクトを選択して、このスキーマを表示してください。

AdlsGen2AccountAssetAdlsGen2AccountAssetスキーマ:
{
              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 つの JSON オブジェクト
BlobAccountAssetBlobAccountAssetスキーマ:
{
              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
            }

適用対象