r 使用AWS简单通知服务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 使用AWS简单通知服务相关的知识,希望对你有一定的参考价值。

library(aws.sns)

Sys.setenv("AWS_ACCESS_KEY_ID" = ,
           "AWS_SECRET_ACCESS_KEY" = ,
           "AWS_DEFAULT_REGION" = "eu-central-1")

topic <- create_topic(name = "TestTopic")
set_topic_attrs(topic, attribute = c(DisplayName = "Publicly visible topic name"))

subscribe(topic, "carlos@herobalancer.nl", protocol = "email")

publish(topic = topic, message = "The timestamp is stopped", subject = "Failure")

###

failstamp <- create_topic(name = "timestamp_spanbroek_failure")
set_topic_attrs(failstamp, attribute = c(DisplayName = "Failure in Spanbroek recording"))
# subscribe(failstamp, "sjoerd@herobalancer.nl", protocol = "email")


publish(topic = failstamp, message = "According with this test script, the timestamp of the data retrieved from kropman hasn't changed in the last hour, or consists just in NA's. 
        Perhaps something is wrong.",
        subject = "The timestamp has stopped")

以上是关于r 使用AWS简单通知服务的主要内容,如果未能解决你的问题,请参考以下文章