@Inject
ImageFactory imageFactory;
@Override
protected void addChildren() throws OpsException {
final OpenstackInstance model = OpsContext.get().getInstance(OpenstackInstance.class);
CloudInstanceMapper instance;
{
instance = injected(CloudInstanceMapper.class);
instance.instance = model;
addChild(instance);
}
{
OpsProvider<TagChanges> tagChanges = new OpsProvider<TagChanges>() {
@Override
public TagChanges get() {
OpenstackComputeMachine machine = OpsContext.get().getInstance(OpenstackComputeMachine.class);
TagChanges tagChanges = new TagChanges();
tagChanges.addTags.add(Tag.INSTANCE_KEY.build(model.getKey()));
tagChanges.addTags.addAll(machine.buildAddressTags());
return tagChanges;
}
};