Пример #1
0
 /// <summary>
 /// Captures the specified resource group as a template.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group to export as a template.
 /// </param>
 /// <param name='parameters'>
 /// Parameters for exporting the template.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ResourceGroupExportResult> ExportTemplateAsync(this IResourceGroupsOperations operations, string resourceGroupName, ExportTemplateRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ExportTemplateWithHttpMessagesAsync(resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        public async Task <IResourceGroupExportResult> ExportTemplateAsync(ResourceGroupExportTemplateOptions options, CancellationToken cancellationToken = default(CancellationToken))
        {
            ExportTemplateRequest exportTemplateRequest = new ExportTemplateRequest();

            exportTemplateRequest.Resources = new List <string>()
            {
                "*"
            };
            exportTemplateRequest.Options = EnumNameAttribute.GetName(options);
            var result = await client.ExportTemplateWithHttpMessagesAsync(Name, exportTemplateRequest, cancellationToken : cancellationToken);

            return(new ResourceGroupExportResultImpl(result.Body));
        }