Class AwsEc2Template

java.lang.Object
org.cloudsimplus.vmtemplates.AwsEc2Template
All Implemented Interfaces:
Comparable<AwsEc2Template>

public class AwsEc2Template
extends Object
implements Comparable<AwsEc2Template>
Represents an Amazon EC2 VM Instance template. This class enables reading a template from a JSON file, containing actual configurations for VMs available in Amazon Web Services.

For more details, check Raysa Oliveira's Master Thesis (only in Portuguese).

Author:
raysaoliveira
See Also:
getInstance(String)
  • Field Details

  • Constructor Details

    • AwsEc2Template

      public AwsEc2Template()
      Default constructor used to create an AwsEc2Template instance. If you want to get a template from a JSON file, you shouldn't call the constructor directly. Instead, use some methods such as the getInstance(String).

      This constructor is just provided to enable the Gson object to use reflection to instantiate a AwsEc2Template.

      See Also:
      getInstance(String)
    • AwsEc2Template

      public AwsEc2Template​(AwsEc2Template source)
      A clone constructor which receives an AwsEc2Template and creates a clone of it.
      Parameters:
      source - the AwsEc2Template to be cloned
    • AwsEc2Template

      public AwsEc2Template​(String jsonFilePath)
      Instantiates an AWS EC2 Instance from a JSON file.
      Parameters:
      jsonFilePath - the full path to the JSON file representing the template with configurations for an AWS EC2 Instance
      See Also:
      getInstance(String)
  • Method Details

    • getInstance

      public static AwsEc2Template getInstance​(String jsonFilePath)
      Gets an AWS EC2 Instance from a JSON file inside the application's resource directory. Use the available constructors if you want to load a file outside the resource directory.
      Parameters:
      jsonFilePath - the relative path to the JSON file representing the template with configurations for an AWS EC2 Instance
      Returns:
      the AWS EC2 Instance from the JSON file
    • getName

      public String getName()
    • setName

      public void setName​(String name)
    • getCpus

      public int getCpus()
    • setCpus

      public void setCpus​(int cpus)
    • getMemoryInMB

      public int getMemoryInMB()
    • setMemoryInMB

      public void setMemoryInMB​(int memoryInMB)
    • getPricePerHour

      public double getPricePerHour()
      Gets the price per hour of a VM created from this template
      Returns:
    • setPricePerHour

      public void setPricePerHour​(double pricePerHour)
    • getRegion

      public String getRegion()
      Gets the AWS Region in which the instance is run.
      Returns:
      See Also:
      AWS Regions, Availability Zones, and Local Zones
    • setRegion

      public void setRegion​(String region)
    • getFilePath

      public String getFilePath()
      Gets the full path to the JSON template file used to create this template.
      Returns:
    • getFileName

      public String getFileName()
      Gets only the name of the JSON template file used to create this template, without the path.
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo​(AwsEc2Template template)
      Specified by:
      compareTo in interface Comparable<AwsEc2Template>