Interface ImageApi


  • @Consumes("application/json")
    @Path("/images")
    public interface ImageApi
    Provides access to the OpenStack Compute (Nova) Image API.
    • Method Detail

      • list

        @Named("image:list")
        @GET
        PagedIterable<Resource> list()
        List all images (IDs, names, links)
        Returns:
        all images (IDs, names, links)
      • listInDetail

        @Named("image:list")
        @GET
        @Path("/detail")
        PagedIterable<Image> listInDetail()
        List all images (all details)
        Returns:
        all images (all details)
      • get

        @Named("image:get")
        @GET
        @Path("/{id}")
        @Nullable
        Image get​(@PathParam("id")
                  String id)
        List details of the specified image
        Parameters:
        id - id of the server
        Returns:
        server or null if not found
      • delete

        @Named("image:delete")
        @DELETE
        @Path("/{id}")
        void delete​(@PathParam("id")
                    String id)
        Delete the specified image
        Parameters:
        id - id of the image
      • getMetadata

        @Named("image:getMetadata")
        @GET
        @Path("/{id}/metadata")
        Map<String,​String> getMetadata​(@PathParam("id")
                                             String id)
        List all metadata for an image.
        Parameters:
        id - id of the image
        Returns:
        the metadata as a Map
      • setMetadata

        @Named("image:setMetadata")
        @PUT
        @Path("/{id}/metadata")
        @Produces("application/json")
        Map<String,​String> setMetadata​(@PathParam("id")
                                             String id,
                                             Map<String,​String> metadata)
        Sets the metadata for an image.
        Parameters:
        id - id of the image
        metadata - a Map containing the metadata
        Returns:
        the metadata as a Map
      • updateMetadata

        @Named("image:updateMetadata")
        @POST
        @Path("/{id}/metadata")
        @Produces("application/json")
        Map<String,​String> updateMetadata​(@PathParam("id")
                                                String id,
                                                Map<String,​String> metadata)
        Update the metadata for a server.
        Parameters:
        id - id of the image
        metadata - a Map containing the metadata
        Returns:
        the metadata as a Map
      • getMetadata

        @Named("image:getMetadata")
        @GET
        @Path("/{id}/metadata/{key}")
        @Nullable
        String getMetadata​(@PathParam("id")
                           String id,
                           @PathParam("key")
                           String key)
        Update the metadata for an image.
        Parameters:
        id - id of the image
        metadata - a Map containing the metadata
        Returns:
        the value or null if not present
      • updateMetadata

        @Named("image:updateMetadata")
        @PUT
        @Path("/{id}/metadata/{key}")
        @Nullable
        String updateMetadata​(@PathParam("id")
                              String id,
                              @PathParam("key")
                              String key,
                              @PathParam("value")
                              String value)
        Set a metadata item for an image.
        Parameters:
        id - id of the image
        key - the name of the metadata item
        value - the value of the metadata item
        Returns:
        the value you updated
      • deleteMetadata

        @Named("image:deleteMetadata")
        @DELETE
        @Path("/{id}/metadata/{key}")
        void deleteMetadata​(@PathParam("id")
                            String id,
                            @PathParam("key")
                            String key)
        Delete a metadata item from an image.
        Parameters:
        id - id of the image
        key - the name of the metadata item