0
aws sdk for java(スタンドアロンのaws iot java sdkではなく)を使用してルールを作成しようとしています。awot java sdkでアクションをiotルールに設定するには?
は、これまでのところ、私は上記のコードでこれらの
public class Application extends Controller {
static AWSIotClient awsIotClient;
private static void init() {
AWSCredentials credentials = null;
try {
credentials = new ProfileCredentialsProvider().getCredentials();
} catch (Exception e) {
throw new AmazonClientException(
"Cannot load the credentials from the credential profiles file. " +
"Please make sure that your credentials file is at the correct " +
"location (~/.aws/credentials), and is in valid format.",
e);
}
awsIotClient = new AWSIotClient(credentials);
Region usEast1 = Region.getRegion(Regions.US_EAST_1);
awsIotClient.setRegion(usEast1);
Logger.info("Creds init");
}
public static Result index() {
init();
CreateTopicRuleRequest another_test = new CreateTopicRuleRequest();
another_test.setRuleName("test");
TopicRulePayload topicRulePayload = new TopicRulePayload();
topicRulePayload.setDescription("A test rule");
topicRulePayload.setSql("SELECT state.reported.turbineStatus FROM '$aws/things/turbine1/shadow/update/accepted' WHERE state.reported.turbineStatus=true");
topicRulePayload.setActions(); // stuck here
another_test.setTopicRulePayload(topicRulePayload);
CreateTopicRuleResult test = awsIotClient.createTopicRule(another_test);
return ok(index.render("iot"));
}
}
を行っている、私は私がそれにアクションを設定するにはどうすればよいの部分でtopicRulePayload.setActions();
を突っ込みましたか?私はそのソースコードを見て、それがコレクションを使用していることを知った。