@SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Publishes metrics to Amazon CloudWatch. Metric can be either a single value, or a StatisticSet comprised of minimum, maximum, sum and sample count.") @DynamicProperty(name="Dimension Name", value="Dimension Value", description="Allows dimension name/value pairs to be added to the metric. AWS supports a maximum of 10 dimensions.", supportsExpressionLanguage=true) @Tags(value={"amazon","aws","cloudwatch","metrics","put","publish"}) public class PutCloudWatchMetric extends AbstractAWSCredentialsProviderProcessor<com.amazonaws.services.cloudwatch.AmazonCloudWatchClient>
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
MAXIMUM |
static PropertyDescriptor |
METRIC_NAME |
static PropertyDescriptor |
MINIMUM |
static PropertyDescriptor |
NAMESPACE |
static java.util.List<PropertyDescriptor> |
properties |
static java.util.Set<Relationship> |
relationships |
static PropertyDescriptor |
SAMPLECOUNT |
static PropertyDescriptor |
SUM |
static PropertyDescriptor |
TIMESTAMP |
static PropertyDescriptor |
UNIT |
static PropertyDescriptor |
VALUE |
AWS_CREDENTIALS_PROVIDER_SERVICE
ACCESS_KEY, client, CREDENTIALS_FILE, DEFAULT_PROTOCOL, DEFAULT_USER_AGENT, ENDPOINT_OVERRIDE, PROXY_HOST, PROXY_HOST_PORT, region, REGION, REL_FAILURE, REL_SUCCESS, SECRET_KEY, SSL_CONTEXT_SERVICE, TIMEOUT
Constructor and Description |
---|
PutCloudWatchMetric() |
Modifier and Type | Method and Description |
---|---|
protected com.amazonaws.services.cloudwatch.AmazonCloudWatchClient |
createClient(ProcessContext processContext,
com.amazonaws.auth.AWSCredentials awsCredentials,
com.amazonaws.ClientConfiguration clientConfiguration)
Deprecated.
|
protected com.amazonaws.services.cloudwatch.AmazonCloudWatchClient |
createClient(ProcessContext processContext,
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
com.amazonaws.ClientConfiguration clientConfiguration)
Create client using aws credentials provider.
|
protected java.util.Collection<ValidationResult> |
customValidate(ValidationContext validationContext)
Allows subclasses to perform their own validation on the already set
properties.
|
java.util.Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(java.lang.String propertyDescriptorName)
Used to allow subclasses to determine what PropertyDescriptor if any to
use when a property is requested for which a descriptor is not already
registered.
|
protected java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
void |
onPropertyModified(PropertyDescriptor descriptor,
java.lang.String oldValue,
java.lang.String newValue)
Hook method allowing subclasses to eagerly react to a configuration
change for the given property descriptor.
|
void |
onTrigger(ProcessContext context,
ProcessSession session) |
protected com.amazonaws.services.cloudwatch.model.PutMetricDataResult |
putMetricData(com.amazonaws.services.cloudwatch.model.PutMetricDataRequest metricDataRequest) |
getCredentialsProvider, onScheduled, onScheduledUsingControllerService, onShutDown
createConfiguration, getClient, getCredentials, getRegion, initializeRegionAndEndpoint, onShutdown
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
public static final java.util.Set<Relationship> relationships
public static final PropertyDescriptor NAMESPACE
public static final PropertyDescriptor METRIC_NAME
public static final PropertyDescriptor VALUE
public static final PropertyDescriptor TIMESTAMP
public static final PropertyDescriptor UNIT
public static final PropertyDescriptor MAXIMUM
public static final PropertyDescriptor MINIMUM
public static final PropertyDescriptor SAMPLECOUNT
public static final PropertyDescriptor SUM
public static final java.util.List<PropertyDescriptor> properties
protected java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(java.lang.String propertyDescriptorName)
AbstractConfigurableComponent
Used to allow subclasses to determine what PropertyDescriptor if any to use when a property is requested for which a descriptor is not already registered. By default this method simply returns a null descriptor. By overriding this method processor implementations can support dynamic properties since this allows them to register properties on demand. It is acceptable for a dynamically generated property to indicate it is required so long as it is understood it is only required once set. Dynamic properties by definition cannot be required until used.
This method should be side effect free in the subclasses in terms of how often it is called for a given property name because there is guarantees how often it will be called for a given property name.
Default is null.
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
propertyDescriptorName
- used to lookup if any property descriptors exist for that namepublic void onPropertyModified(PropertyDescriptor descriptor, java.lang.String oldValue, java.lang.String newValue)
AbstractConfigurableComponent
onPropertyModified
in interface ConfigurableComponent
onPropertyModified
in class AbstractConfigurableComponent
descriptor
- of the modified propertyoldValue
- non-null property value (previous)newValue
- the new property value or if null indicates the property
was removedpublic java.util.Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractAWSProcessor<com.amazonaws.services.cloudwatch.AmazonCloudWatchClient>
protected java.util.Collection<ValidationResult> customValidate(ValidationContext validationContext)
AbstractConfigurableComponent
customValidate
in class AbstractAWSProcessor<com.amazonaws.services.cloudwatch.AmazonCloudWatchClient>
validationContext
- provides a mechanism for obtaining externally
managed values, such as property values and supplies convenience methods
for operating on those valuesprotected com.amazonaws.services.cloudwatch.AmazonCloudWatchClient createClient(ProcessContext processContext, com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.ClientConfiguration clientConfiguration)
createClient
in class AbstractAWSCredentialsProviderProcessor<com.amazonaws.services.cloudwatch.AmazonCloudWatchClient>
processContext
- process contextawsCredentialsProvider
- aws credentials providerclientConfiguration
- aws client configurationprotected com.amazonaws.services.cloudwatch.AmazonCloudWatchClient createClient(ProcessContext processContext, com.amazonaws.auth.AWSCredentials awsCredentials, com.amazonaws.ClientConfiguration clientConfiguration)
createClient(ProcessContext, AWSCredentialsProvider, ClientConfiguration)
insteadcreateClient
in class AbstractAWSProcessor<com.amazonaws.services.cloudwatch.AmazonCloudWatchClient>
processContext
- process contextawsCredentials
- static aws credentialsclientConfiguration
- aws client configurationpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
protected com.amazonaws.services.cloudwatch.model.PutMetricDataResult putMetricData(com.amazonaws.services.cloudwatch.model.PutMetricDataRequest metricDataRequest) throws com.amazonaws.AmazonClientException
com.amazonaws.AmazonClientException