Class: UU::OperationRegistry::Volume

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

Overview

Volume.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ Volume

Creates a new instance of Volume.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

.create(cloud_uri, attributes) ⇒ UU::OS::UESURI

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

Examples:

Create example


volume = {
  name: "My First Volume",
  driver: "cloudstor:azure",
  source: "80fb27714e674b3b90389b92da1fe947",
  destination: "/data",
  appDeploymentUri: UU::OS::UESURI.new("ues:[78462435]:[571fb9da2792891f35e22919]:[5739c55927928929b914820f]"),
  code: "a357881e59965819e14581e8",
}

UU::OperationRegistry::Volume.create(cloud_uri, volume)

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Volume attributes.

Options Hash (attributes):

  • name (String)

    Volume name. May be nil.

  • code (String)

    Serves as identifier for a volume. May be nil.

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

    URI of AppDeployment the Volume is assigned to.

  • driver (String)

    Name of Docker volume plugin to use; the only currently supported value is cloudstor:azure

  • source (String)

    Identifier of the persistent storage on the cloud platform. The recommended format is hexa32code. E.g. name of File Share in Azure Files to use as backing storage.

  • destination (String)

    The path in the particular uuNode where the volume shall be mounted.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created Volume.



# File 'lib/uu/operation_registry/volume.rb', line 37

.delete(volume_uri) ⇒ void

This method returns an undefined value.

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

Parameters:

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

    Volume URI.



# File 'lib/uu/operation_registry/volume.rb', line 107

.get_attributes(volume_uri) ⇒ Hash

Gets the attributes of the Volume specified by volume URI. This method is a convenience shortcut for the #get_attributes instance method.

Parameters:

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

    Volume URI.

Returns:

  • (Hash)

    Volume attributes.



# File 'lib/uu/operation_registry/volume.rb', line 70

.get_volume_list(cloud_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Returns list of Volumes. This method is a convenience shortcut for the #get_volume_list instance method.

Returns:

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

    Paged result set.

See Also:



135
136
137
# File 'lib/uu/operation_registry/volume.rb', line 135

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

.set_attributes(volume_uri, attributes) ⇒ UU::OS::UESURI

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

Parameters:

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

    Volume URI.

  • attributes (Hash)

    Volume attributes to update.

Options Hash (attributes):

  • name (String)

    Volume name. May be nil.

  • code (String)

    Serves as identifier for a volume.

  • source (String)

    Identifier of the persistent storage on the cloud platform. The recommended format is hexa32code. E.g. name of File Share in Azure Files to use as backing storage.

  • destination (String)

    The path in the particular uuNode where the volume shall be mounted.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated Volume.



# File 'lib/uu/operation_registry/volume.rb', line 89

Instance Method Details

#create(cloud_uri, attributes) ⇒ UU::OS::UESURI

Creates a new Volume.

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Volume attributes.

Options Hash (attributes):

  • name (String)

    Volume name. May be nil.

  • code (String)

    Serves as identifier for a volume. May be nil.

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

    URI of AppDeployment the Volume is assigned to.

  • driver (String)

    Name of Docker volume plugin to use; the only currently supported value is cloudstor:azure

  • source (String)

    Identifier of the persistent storage on the cloud platform. The recommended format is hexa32code. E.g. name of File Share in Azure Files to use as backing storage.

  • destination (String)

    The path in the particular uuNode where the volume shall be mounted.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created Volume.



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

#delete(volume_uri) ⇒ void

This method returns an undefined value.

Deletes the specified Volume from the registry.

Parameters:

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

    Volume URI.



# File 'lib/uu/operation_registry/volume.rb', line 102

#get_attributes(volume_uri) ⇒ Hash

Gets the attributes of the Volume specified by volume URI.

Parameters:

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

    Volume URI.

Returns:

  • (Hash)

    Volume attributes.



# File 'lib/uu/operation_registry/volume.rb', line 65

#get_volume_list(cloud_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>

Returns a list of Volumes for the given Cloud. Command does not return all Volumes, only a sublist. The list of returned Volumes could be filtered using Mongo Query.

Parameters:

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

    Cloud URI.

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

    Criteria for listing Volumes.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial. Allowed query filter document fields: name, code, driver, source, destination, appDeploymentUri

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

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

    Paged result set.



126
127
128
# File 'lib/uu/operation_registry/volume.rb', line 126

def get_volume_list(cloud_uri, criteria = {})
  @client.invoke(:getVolumeList, cloud_uri, parameters: criteria)
end

#set_attributes(volume_uri, attributes) ⇒ UU::OS::UESURI

Sets attributes of a Volume.

Parameters:

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

    Volume URI.

  • attributes (Hash)

    Volume attributes to update.

Options Hash (attributes):

  • name (String)

    Volume name. May be nil.

  • code (String)

    Serves as identifier for a volume.

  • source (String)

    Identifier of the persistent storage on the cloud platform. The recommended format is hexa32code. E.g. name of File Share in Azure Files to use as backing storage.

  • destination (String)

    The path in the particular uuNode where the volume shall be mounted.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated Volume.



# File 'lib/uu/operation_registry/volume.rb', line 77