Class: UU::OperationRegistry::Container

Inherits:
BaseMethods
  • Object
show all
Defined in:
lib/uu/operation_registry/container.rb

Overview

Container for running applications.

Constant Summary

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Container) initialize(session = nil)

Creates a new instance of Container.

Parameters:

  • session (UU::OS::Security::Session) (defaults to: nil)

    Session to use for remote calls.



18
19
20
# File 'lib/uu/operation_registry/container.rb', line 18

def initialize(session = nil)
  super
end

Class Method Details

+ (UU::OS::UESURI) create(node_uri, attributes)

Creates a new container. This method is a convenience shortcut for the #create instance method.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

  • attributes (Hash)

    Container attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created container.



# File 'lib/uu/operation_registry/container.rb', line 39

+ (void) delete(container_uri)

This method returns an undefined value.

Deletes the specified container from the registry. This method is a convenience shortcut for the #delete instance method.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.



# File 'lib/uu/operation_registry/container.rb', line 84

+ (Hash) get_attributes(container_uri)

Gets the attributes of the container specified by container URI and returns its detail. This method is a convenience shortcut for the #get_attributes instance method.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.

Returns:

  • (Hash)

    Container attributes.



# File 'lib/uu/operation_registry/container.rb', line 52

+ (UU::OS::Persistence::PagedResult<Hash>) get_container_list(node_uri, criteria = {})

Returns list of containers. This method is a convenience shortcut for the #get_container_list instance method.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.

See Also:



111
112
113
# File 'lib/uu/operation_registry/container.rb', line 111

def self.get_container_list(node_uri, criteria = {})
  self.new(UU::OS::Security::Session.current_session).get_container_list(node_uri, criteria)
end

+ (UU::OS::UESURI) set_attributes(container_uri, attributes)

Sets attributes of a container. This method is a convenience shortcut for the #set_attributes instance method.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated container.



# File 'lib/uu/operation_registry/container.rb', line 73

Instance Method Details

- (UU::OS::UESURI) create(node_uri, attributes)

Creates a new container.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

  • attributes (Hash)

    Container attributes.

Options Hash (attributes):

  • name (String)

    Container name.

  • code (String)

    Container code. May be nil.

  • description (String)

    Container description. May be nil.

  • nodeImageUri (UU::OS::UESURI)

    Image URI.

  • inboundPorts (Array<Fixnum>)

    Inbound ports. May be nil.

  • nodeSetUri (UU::OS::UESURI)

    Node group URI.

  • state (String)

    Container state. Value must be one from AppDeploymentState. May be nil.

  • appDeploymentUri (UU::OS::UESURI)

    UESURI of deployment that this container belongs to. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created container.



# File 'lib/uu/operation_registry/container.rb', line 22

- (void) delete(container_uri)

This method returns an undefined value.

Deletes the specified container from the registry.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.



# File 'lib/uu/operation_registry/container.rb', line 79

- (Hash) get_attributes(container_uri)

Gets the attributes of the container specified by container URI and returns its detail.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.

Returns:

  • (Hash)

    Container attributes.



# File 'lib/uu/operation_registry/container.rb', line 46

- (UU::OS::Persistence::PagedResult<Hash>) get_container_list(node_uri, criteria = {})

Returns a list of containers on the given node. Command does not return all containers, only a sublist. The list of returned containers could be filtered using Mongo Query.

Parameters:

  • node_uri (String, UU::OS::UESURI)

    Node URI.

  • criteria (Hash) (defaults to: {})

    Criteria for listing containers.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial.

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

  • (UU::OS::Persistence::PagedResult<Hash>)

    Paged result set.



102
103
104
# File 'lib/uu/operation_registry/container.rb', line 102

def get_container_list(node_uri, criteria = {})
  @client.invoke(:getContainerList, node_uri, parameters: criteria)
end

- (UU::OS::UESURI) set_attributes(container_uri, attributes)

Sets attributes of a container.

Parameters:

  • container_uri (String, UU::OS::UESURI)

    Container URI.

  • attributes (Hash)

    Container attributes.

Options Hash (attributes):

  • name (String)

    Container name. May be nil.

  • code (String)

    Container code. May be nil.

  • description (String)

    Container description. May be nil.

  • state (String)

    Container state. Value must be one from AppDeploymentState. May be nil.

  • appDeploymentUri (UU::OS::UESURI)

    UESURI of deployment that this container belongs to. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated container.



# File 'lib/uu/operation_registry/container.rb', line 59