Amazon.EC2.Import.DiskImageImporter.FromManifest C# (CSharp) Метод

FromManifest() публичный статический Метод

Constructs an importer instance for a previously uploaded manifest. The manifest is downloaded using a new Amazon S3 client constructed for the specified region and deserialized, ready for use in constructing the appropriate ImportInstance or ImportVolume request to Amazon EC2.
public static FromManifest ( AWSCredentials credentials, RegionEndpoint region, string bucketName, string manifestFileKey, bool resumingUpload ) : DiskImageImporter
credentials Amazon.Runtime.AWSCredentials /// The AWS credentials for the account that owns or has access to the bucket containing the manifest file. ///
region RegionEndpoint The region in which the Amazon S3 client used for download will be constructed.
bucketName string The name of the bucket containing the manifest file.
manifestFileKey string The S3 object key of the manifest file.
resumingUpload bool /// Set this to true if a previous upload failed part-way through processing and RetainArtifactsOnUploadError /// was set to true so the partially uploaded content was retained. The existing manifest will /// be inspected and uploads can then resume to process the retaining content. ///
Результат DiskImageImporter
        public static DiskImageImporter FromManifest(AWSCredentials credentials, 
                                                     RegionEndpoint region, 
                                                     string bucketName, 
                                                     string manifestFileKey,
                                                     bool resumingUpload)
        {
            try
            {
                var importer = new DiskImageImporter(credentials, region, bucketName)
                {
                    ManifestFileKey = manifestFileKey
                };
                importer.DeserializeManifestFromS3();

                if (resumingUpload)
                    importer.DetermineRemainingUploads();

                return importer;
            }
            catch (XmlException e)
            {
                throw new DiskImageImporterException(DiskImportErrorStage.ManifestInspection, 
                                                     "Failed to deserialize the downloaded manifest", 
                                                     e);
            }
            catch (Exception e)
            {
                var msg = string.Format(CultureInfo.InvariantCulture,
                                        "Failed to download the specified manifest from bucket {0} with key {1}",
                                        bucketName,
                                        manifestFileKey);
                throw new DiskImageImporterException(DiskImportErrorStage.ManifestInspection, msg, e);
            }
        }