本文整理汇总了C#中Amazon.CloudWatch.AmazonCloudWatchConfig类的典型用法代码示例。如果您正苦于以下问题:C# AmazonCloudWatchConfig类的具体用法?C# AmazonCloudWatchConfig怎么用?C# AmazonCloudWatchConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonCloudWatchConfig类属于Amazon.CloudWatch命名空间,在下文中一共展示了AmazonCloudWatchConfig类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AmazonCloudWatchClient
/// <summary>
/// Constructs AmazonCloudWatchClient with the credentials defined in the App.config.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSAccessKey" value="********************"/>
/// <add key="AWSSecretKey" value="****************************************"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonElasticBeanstalkClient Configuration Object</param>
public AmazonCloudWatchClient(AmazonCloudWatchConfig config)
: base(new EnvironmentAWSCredentials(), config, true, AuthenticationTypes.User)
{
}
开发者ID:buddydvd,项目名称:aws-sdk-for-net,代码行数:20,代码来源:AmazonCloudWatchClient.cs
示例2: CreateAmazonCloudWatchClient
/// <summary>
/// Create a client for the Amazon CloudWatch Service with the specified configuration
/// </summary>
/// <param name="awsAccessKey">The AWS Access Key associated with the account</param>
/// <param name="awsSecretAccessKey">The AWS Secret Access Key associated with the account</param>
/// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc
/// </param>
/// <returns>An Amazon CloudWatch client</returns>
/// <remarks>
/// </remarks>
public static IAmazonCloudWatch CreateAmazonCloudWatchClient(
string awsAccessKey,
string awsSecretAccessKey, AmazonCloudWatchConfig config
)
{
return new AmazonCloudWatchClient(awsAccessKey, awsSecretAccessKey, config);
}
开发者ID:sadiqj,项目名称:aws-sdk-xamarin,代码行数:17,代码来源:AWSClientFactory.cs
示例3: AmazonCloudWatchClient
/// <summary>
/// Constructs AmazonCloudWatchClient with AWS Credentials and an
/// AmazonCloudWatchClient Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="clientConfig">The AmazonCloudWatchClient Configuration Object</param>
public AmazonCloudWatchClient(AWSCredentials credentials, AmazonCloudWatchConfig clientConfig)
: base(credentials, clientConfig)
{
}
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:10,代码来源:AmazonCloudWatchClient.cs
示例4: CreateAmazonCloudWatchClient
/// <summary>
/// Create a client for the Amazon CloudWatch Service with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSAccessKey" value="********************"/>
/// <add key="AWSSecretKey" value="****************************************"/>
/// </appSettings>
/// </configuration>
/// </code>
/// </summary>
/// <param name="config">Configuration options for the service like HTTP Proxy, # of connections, etc</param>
/// <returns>An Amazon CloudWatch client</returns>
public static AmazonCloudWatch CreateAmazonCloudWatchClient(AmazonCloudWatchConfig config)
{
return new AmazonCloudWatchClient(config);
}
开发者ID:rguarino4,项目名称:aws-sdk-net,代码行数:21,代码来源:AWSClientFactory.cs
示例5: AmazonCloudWatchClient
/// <summary>
/// Constructs AmazonCloudWatchClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCloudWatchClient 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 AmazonCloudWatchClient Configuration Object</param>
public AmazonCloudWatchClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudWatchConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig, AuthenticationTypes.User | AuthenticationTypes.Session)
{
}
开发者ID:scopely,项目名称:aws-sdk-net,代码行数:15,代码来源:AmazonCloudWatchClient.cs
示例6: AmazonCloudWatchClient
/// <summary>
/// Constructs AmazonCloudWatchClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSAccessKey" value="********************"/>
/// <add key="AWSSecretKey" value="****************************************"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonCloudWatch Configuration Object</param>
public AmazonCloudWatchClient(AmazonCloudWatchConfig config)
: base(FallbackCredentialsFactory.GetCredentials(), config, true, AuthenticationTypes.User)
{
}
开发者ID:pbutlerm,项目名称:dataservices-sdk-dotnet,代码行数:21,代码来源:AmazonCloudWatchClient.cs
示例7: CreateClient
private IAmazonCloudWatch CreateClient()
{
// Submit in the region that was specified in the config file.
AmazonCloudWatchConfig config = new AmazonCloudWatchConfig()
{
RegionEndpoint = Amazon.RegionEndpoint.GetBySystemName(_regionName)
};
return new AmazonCloudWatchClient(config);
}
开发者ID:eleven41,项目名称:CloudWatchMonitor,代码行数:10,代码来源:MonitorService.cs
示例8: SetupClient
private void SetupClient()
{
if (_client != null)
return;
AmazonCloudWatchConfig cloudWatchConfig = null;
RegionEndpoint regionEndpoint = null;
if (string.IsNullOrEmpty(EndPoint) && ConfigurationManager.AppSettings["AWSServiceEndpoint"] != null)
EndPoint = ConfigurationManager.AppSettings["AWSServiceEndpoint"];
if (string.IsNullOrEmpty(AccessKey) && ConfigurationManager.AppSettings["AWSAccessKey"] != null)
AccessKey = ConfigurationManager.AppSettings["AWSAccessKey"];
if (string.IsNullOrEmpty(Secret) && ConfigurationManager.AppSettings["AWSSecretKey"] != null)
Secret = ConfigurationManager.AppSettings["AWSSecretKey"];
_client = AWSClientFactory.CreateAmazonCloudWatchClient(AccessKey, Secret);
try
{
if (!string.IsNullOrEmpty(EndPoint))
{
if (EndPoint.StartsWith("http"))
{
cloudWatchConfig = new AmazonCloudWatchConfig { ServiceURL = EndPoint };
if (string.IsNullOrEmpty(AccessKey))
_client = AWSClientFactory.CreateAmazonCloudWatchClient(cloudWatchConfig);
}
else
{
regionEndpoint = RegionEndpoint.GetBySystemName(EndPoint);
if (string.IsNullOrEmpty(AccessKey))
_client = AWSClientFactory.CreateAmazonCloudWatchClient(regionEndpoint);
}
}
}
catch (AmazonServiceException)
{
}
if (!string.IsNullOrEmpty(AccessKey))
if (regionEndpoint != null)
_client = AWSClientFactory.CreateAmazonCloudWatchClient(AccessKey, Secret, regionEndpoint);
else if (cloudWatchConfig != null)
_client = AWSClientFactory.CreateAmazonCloudWatchClient(AccessKey, Secret, cloudWatchConfig);
else
_client = AWSClientFactory.CreateAmazonCloudWatchClient(AccessKey, Secret);
//Debug
var metricDatum = new Amazon.CloudWatch.Model.MetricDatum().WithMetricName("CloudWatchAppender").WithValue(1).WithUnit("Count");
//_client.PutMetricData(new PutMetricDataRequest().WithNamespace("CloudWatchAppender").WithMetricData(metricDatum));
}
开发者ID:baskard,项目名称:CloudWatchAppender,代码行数:54,代码来源:CloudWatchAppender.cs
示例9: CreateClient
private AmazonCloudWatch CreateClient()
{
// Submit in the region that the instance is local to
var config = new AmazonCloudWatchConfig
{
ServiceURL = String.Format("http://monitoring.{0}.amazonaws.com", _region)
};
return new AmazonCloudWatchClient(_amazonAccessKeyId, _amazonSecretAccessKey, config);
}
开发者ID:aioue,项目名称:CloudWatchMonitor,代码行数:9,代码来源:MonitorService.cs
注:本文中的Amazon.CloudWatch.AmazonCloudWatchConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论