本文整理汇总了C#中Amazon.Glacier.AmazonGlacierConfig类的典型用法代码示例。如果您正苦于以下问题:C# AmazonGlacierConfig类的具体用法?C# AmazonGlacierConfig怎么用?C# AmazonGlacierConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonGlacierConfig类属于Amazon.Glacier命名空间,在下文中一共展示了AmazonGlacierConfig类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FDGlacier
public FDGlacier(FDUserSettings settings, FDOperationLog oplog, string optype)
{
this.vaultName = settings.AWSGlacierVaultName;
log = oplog;
switch (settings.AWSRegion) {
case FDUserSettings.AWSRegionIndex.USWest1:
region = RegionEndpoint.USWest1;
break;
case FDUserSettings.AWSRegionIndex.USWest2:
region = RegionEndpoint.USWest2;
break;
case FDUserSettings.AWSRegionIndex.USEast1:
region = RegionEndpoint.USEast1;
break;
case FDUserSettings.AWSRegionIndex.EUWest1:
region = RegionEndpoint.EUWest1;
break;
case FDUserSettings.AWSRegionIndex.APNortheast1:
region = RegionEndpoint.APNortheast1;
break;
default:
region = RegionEndpoint.USEast1;
break;
}
//Instantiate the glacier config with our settins (for future move to AmazonGlacierClient)
glacierConfig = new AmazonGlacierConfig();
glacierConfig.RegionEndpoint = region;
//Instantiate AWS Credentials
awsCredentials = new BasicAWSCredentials(settings.AWSAccessKey, settings.AWSSecretKey);
//Instantiate the transfer manager with our settings
//TODO: Switch to glacier client so we can abort this damn thing
//glacierClient = new AmazonGlacierClient(appConfig["AWSAccessKey"], appConfig["AWSSecretKey"], region);
transferManager = new ArchiveTransferManager(awsCredentials, region);
upOptions = new UploadOptions();
downOptions = new DownloadOptions();
progress = 0;
upOptions.StreamTransferProgress = downOptions.StreamTransferProgress = this.onProgress;
OperationType = optype;
}
示例2: AmazonGlacierClient
/// <summary>
/// Constructs AmazonGlacierClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonGlacierClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="clientConfig">The AmazonGlacierClient Configuration Object</param>
public AmazonGlacierClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonGlacierConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
示例3: AmazonGlacierClient
/// <summary>
/// Constructs AmazonGlacierClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonGlacierClient Configuration object. If the config object's
/// UseSecureStringForAwsSecretKey is false, the AWS Secret Key
/// is stored as a clear-text string. Please use this option only
/// if the application environment doesn't allow the use of SecureStrings.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="clientConfig">The AmazonGlacierClient Configuration Object</param>
public AmazonGlacierClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonGlacierConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig, AuthenticationTypes.User | AuthenticationTypes.Session)
{
}
示例4: EstablishClient
private OperationResult EstablishClient(AddonManifest manifest, DeveloperOptions devOptions, out AmazonGlacierClient client)
{
OperationResult result;
bool requireCreds;
//var accessKey = manifest.ProvisioningUsername;
//var secretAccessKey = manifest.ProvisioningPassword;
var accessKey = devOptions.AccessKey;
var secretAccessKey = devOptions.SecretAccessKey;
var prop =
manifest.Properties.First(
p => p.Key.Equals("requireDevCredentials", StringComparison.InvariantCultureIgnoreCase));
if (bool.TryParse(prop.Value, out requireCreds) && requireCreds)
{
if (!ValidateDevCreds(devOptions))
{
client = null;
result = new OperationResult()
{
IsSuccess = false,
EndUserMessage =
"The add on requires that developer credentials are specified but none were provided."
};
return result;
}
accessKey = devOptions.AccessKey;
secretAccessKey = devOptions.SecretAccessKey;
}
AmazonGlacierConfig config = new AmazonGlacierConfig() { RegionEndpoint = RegionEndpoint.USEast1 };
client = new AmazonGlacierClient(devOptions.AccessKey, devOptions.SecretAccessKey, config);
result = new OperationResult { IsSuccess = true };
return result;
}
示例5: CreateAmazonGlacierClient
/// <summary>
/// Create a client for the Amazon Glacier Service with AWSCredentials and an AmazonGlacier Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc</param>
/// <returns>An Amazon Glacier client</returns>
/// <remarks>
/// </remarks>
public static IAmazonGlacier CreateAmazonGlacierClient(AWSCredentials credentials, AmazonGlacierConfig config)
{
return new AmazonGlacierClient(credentials, config);
}