Class: UU::OperationRegistry::Secret

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

Overview

Secret.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ Secret

Creates a new instance of Secret.

Parameters:

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

    Session to use for remote calls.



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

def initialize(session = nil)
  super
end

Class Method Details

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

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

Examples:

Create example


secret = {
  name: "OSID mapping",
  code: "v3dphou7k303n2gzfklsxzon9ymlo817",
  value: "mongodb://v3dphou7k303n2gzfklsxzon9ymlo817__b933l3ojvini92p2o9ongo-o-s.eu-n-1.cloud.plus4u.net:27017/v3dphou7k303n2gzfklsxzon9ymlo817"
}

UU::OperationRegistry::Secret.create(cloud_uri, secret)

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Secret attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created Secret.



# File 'lib/uu/operation_registry/secret.rb', line 32

.delete(secret_uri) ⇒ void

This method returns an undefined value.

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

Parameters:

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

    Secret URI.



# File 'lib/uu/operation_registry/secret.rb', line 81

.get_attributes(secret_uri) ⇒ Hash

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

Parameters:

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

    Secret URI.

Returns:

  • (Hash)

    Secret attributes.



# File 'lib/uu/operation_registry/secret.rb', line 53

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

Returns list of Secrets. This method is a convenience shortcut for the #get_secret_list instance method.

Returns:

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

    Paged result set.

See Also:



109
110
111
# File 'lib/uu/operation_registry/secret.rb', line 109

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

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

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

Parameters:

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

    Secret URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated Secret.



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

Instance Method Details

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

Creates a new Secret.

Parameters:

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

    Cloud URI.

  • attributes (Hash)

    Secret attributes.

Options Hash (attributes):

  • name (String)

    Secret name. May be nil.

  • code (String)

    Serves as identifier (for example OSID/BSID) for a secret value.

  • value (String)

    Secret value.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created Secret.



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

#delete(secret_uri) ⇒ void

This method returns an undefined value.

Deletes the specified Secret from the registry.

Parameters:

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

    Secret URI.



# File 'lib/uu/operation_registry/secret.rb', line 76

#get_attributes(secret_uri) ⇒ Hash

Gets the attributes of the Secret specified by secret URI.

Parameters:

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

    Secret URI.

Returns:

  • (Hash)

    Secret attributes.



# File 'lib/uu/operation_registry/secret.rb', line 48

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

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

Parameters:

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

    Cloud URI.

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

    Criteria for listing Secrets.

Options Hash (criteria):

  • query (String)

    Mongo Query to filter the result set. See Mongo Query tutorial. Allowed query filter document fields: code, value.

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

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

    Paged result set.



100
101
102
# File 'lib/uu/operation_registry/secret.rb', line 100

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

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

Sets attributes of a Secret.

Parameters:

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

    Secret URI.

  • attributes (Hash)

    Secret attributes to update.

Options Hash (attributes):

  • name (String)

    Secret name. May be nil.

  • code (String)

    Serves as identifier (for example OSID/BSID) for a secret value.

  • value (String)

    Secret value.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated Secret.



# File 'lib/uu/operation_registry/secret.rb', line 60