def from()

in app/model/Instance.scala [163:180]


  def from(i: AwsEc2Instance, awsCost: AWSCost)(implicit wsClient: WSClient): Future[Instance] = {
    val tags = i.getTags.asScala.map(t => t.getKey -> t.getValue).toMap.withDefaultValue("")
    val dns = i.getPublicDnsName

    val managementTag = ManagementTag(tags.get("Management"))
    val managementEndpoint = managementTag map (ManagementEndpoint(dns, _))

    val specifics =
      if (managementTag.flatMap(_.format).exists(_ == "elasticsearch"))
        new ElasticSearchInstance(i.getPrivateDnsName)
      else
        new StandardWebApp(s"${managementEndpoint.get.url}/manifest")

    log.debug(s"Retrieving version of instance with tags: $tags")
    specifics.version map {
      v => EC2Instance(i, v, specifics.usefulUrls, awsCost)
    }
  }