Interface FlavorService

  • All Superinterfaces:
    RestService
    All Known Implementing Classes:
    FlavorServiceImpl

    public interface FlavorService
    extends RestService
    Flavor service provides CRUD capabilities for Flavor(s). A flavor is an available hardware configuration/template for a server
    Author:
    Jeremy Unruh, whaon
    • Method Detail

      • list

        List<? extends Flavor> list()
        List all Flavors with details
        Returns:
        List of Flavor
      • get

        Flavor get​(String flavorId)
        Get a Flavor by it's identifier
        Parameters:
        flavorId - the flavor identifier
        Returns:
        Flavor
      • delete

        ActionResponse delete​(String flavorId)
        Deletes a Flavor by it's identifier
        Parameters:
        flavorId - the flavor identifier
        Returns:
        the action response
      • create

        Flavor create​(Flavor flavor)
        Creates a new Flavor
        Parameters:
        flavor - the flavor to create
        Returns:
        the created flavor
      • create

        Flavor create​(String name,
                      int ram,
                      int vcpus,
                      int disk,
                      int ephemeral,
                      int swap,
                      float rxtxFactor,
                      boolean isPublic)
        Creates a new Flavor
        Parameters:
        name - the descriptive name of the flavor
        ram - the Memory in MB for the flavor
        vcpus - the Number of VCPUs for the flavor
        disk - the size of the local disk in GB
        the - space in GB that will disappear when the VM is terminated (default is 0) [OPTIONAL]
        swap - the Swap space in MB
        rxtxFactor - the RX/TX factor (default is 1) [OPTIONAL]
        Returns:
        the created flavor
      • listExtraSpecs

        Map<String,​String> listExtraSpecs​(String flavorId)
        list extra specs
        Returns:
        all extra specs for this flavor
      • createAndUpdateExtraSpecs

        Map<String,​String> createAndUpdateExtraSpecs​(String flavorId,
                                                           Map<String,​String> spec)
        post a key-value map, if key exist, value will be updated, if not ,new extra spec created. openstack provides one api to support both create and update extra spec
        Returns:
        spec
      • deleteExtraSpecs

        void deleteExtraSpecs​(String flavorId,
                              String key)
        delete the extra spec with the key and flavorId
      • getSpec

        String getSpec​(String flavorId,
                       String key)
        get the extra spec's value by the key
        Returns:
        value
      • listFlavorAccess

        List<? extends FlavorAccess> listFlavorAccess​(String flavorId)
        List tenants with access to private flavor
        Returns:
        List tenants with access to private flavor
      • addTenantAccess

        List<? extends FlavorAccess> addTenantAccess​(String flavorId,
                                                     String tenantId)
        Add access to private flavor
        Returns:
        List tenants with access to private flavor
      • removeTenantAccess

        List<? extends FlavorAccess> removeTenantAccess​(String flavorId,
                                                        String tenantId)
        Delete access from private flavor
        Returns:
        List tenants with access to private flavor
      • list

        List<? extends Flavor> list​(boolean detail,
                                    Map<String,​String> filteringParams)
        list flavors
        Parameters:
        detail - is detailed
        filteringParams - parameters affect the response data,availbed are:sort_key,sort_dir,limit,marker,minDisk,minRam,is_public
      • list

        List<? extends Flavor> list​(boolean detail)
        list flavors with non filtering parameters