@Override public Zone getZone(Instance instance) { return objectManager.loadResource(Zone.class, instance.getZoneId()); }
public AgentInstanceBuilderImpl(AgentInstanceFactoryImpl factory, Instance instance, Set<String> roles) { this(factory); this.accountId = instance.getAccountId(); this.zoneId = instance.getZoneId(); String uriPrefix = "event"; Map<String, Object> labels = DataAccessor.fieldMap(instance, InstanceConstants.FIELD_LABELS); Object prefix = labels.get(SystemLabels.LABEL_AGENT_URI_PREFIX); if (prefix != null) { uriPrefix = prefix.toString(); } this.uri = uriPrefix + ":///instanceId=" + instance.getId(); this.resourceAccountId = instance.getAccountId(); this.requestedRoles = roles; }
@Override public AgentInstanceBuilder withInstance(Instance instance) { withAccountId(instance.getAccountId()); withZoneId(instance.getZoneId()); return this; }
setImageId(from.getImageId()); setHostname(from.getHostname()); setZoneId(from.getZoneId()); setInstanceTriggeredStop(from.getInstanceTriggeredStop()); setAgentId(from.getAgentId());