Class: UU::OperationRegistry::AppShare

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

Overview

AppShare allows to share one AppDeployment among multiple tenants, allowing to install an deployment to one AppDeployment (belonging to the tenant which has contracted capacity for the AppDeployment) and share it with other tenants.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ AppShare

Creates a new instance of AppShare.

Parameters:

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

    Session to use for remote calls.



21
22
23
# File 'lib/uu/operation_registry/app_share.rb', line 21

def initialize(session = nil)
  super
end

Class Method Details

.bulk_create(app_deployment_uri, attributes) ⇒ Array

Creates multiple shares in one command.

Examples:

require 'uu_operation_registry'

UU::OS::Security::Session.('')
app_deployment_uri = 'ues:TERR:POOL:APP'
shares = [{:tenantUri => 'ues:TERR:TENANT1'},{:tenantUri => 'ues:TERR:TENANT2'}]
UU::OperationRegistry::AppShare.bulk_create(app_deployment_uri, :urlPath => '/url-path', :shares => shares)

Parameters:

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

    app deployment URI.

  • attributes (Hash)

    Attributes for bulk create.

Options Hash (attributes):

  • urlPath (String)

    URL path (“/vendor-app”) used in gateway routing data.

  • shares (Array<Hash>)

    Array of hashes. Maximum is 1000 shares per command. Keys:

    • name (String) AppShare name. May be nil.

    • code (String) AppShare code. May be nil.

    • tenantUri URI(String, UU::OS::UESURI) UESURI of the tenant. Required.

Returns:

  • (Array)

    Array of UESURIs of created AppShares.



143
144
145
# File 'lib/uu/operation_registry/app_share.rb', line 143

def self.bulk_create(app_deployment_uri, attributes)
  self.new(UU::OS::Security::Session.current_session).bulk_create(app_deployment_uri, attributes)
end

.bulk_delete(app_deployment_uri, attributes) ⇒ Array

Removes multiple shares in one command.

Examples:

require 'uu_operation_registry'
UU::OS::Security::Session.('')
app_deployment_uri = 'ues:TERR:POOL:APP'
shares = ['ues:TERR:APPSHARE1', 'ues:TERR:APPSHARE2']
UU::OperationRegistry::AppShare.bulk_delete(app_deployment_uri,  :appShares => shares)

Parameters:

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

    app deployment URI.

  • attributes (Hash)

    Attributes for bulk delete.

Options Hash (attributes):

  • appShares (Array<String, UU::OS::UESURI>)

    Array of UESURIs of AppShares. Maximum is 1000 appShares per command.

Returns:

  • (Array)

    Array of UESURIs of removed AppShares.



172
173
174
# File 'lib/uu/operation_registry/app_share.rb', line 172

def self.bulk_delete(app_deployment_uri, attributes)
  self.new(UU::OS::Security::Session.current_session).bulk_delete(app_deployment_uri, attributes)
end

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

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

Parameters:

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

    App deployment URI.

  • attributes (Hash)

    AppShare attributes.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created app share.



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

.delete(app_share_uri) ⇒ void

This method returns an undefined value.

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

Parameters:

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

    AppShare URI.



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

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

Returns list of app shares. This method is a convenience shortcut for the #get_app_share_list instance method.

Returns:

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

    Paged result set.

See Also:



104
105
106
# File 'lib/uu/operation_registry/app_share.rb', line 104

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

.get_attributes(app_share_uri) ⇒ Hash

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

Parameters:

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

    AppShare URI.

Returns:

  • (Hash)

    AppShare attributes.



# File 'lib/uu/operation_registry/app_share.rb', line 50

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

Sets attributes of an app share. This method is a convenience shortcut for the #set_attributes instance method.

Parameters:

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

    AppShare URI.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated app share.



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

Instance Method Details

#bulk_create(app_deployment_uri, attributes) ⇒ Array

Creates multiple shares in one command.

Parameters:

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

    app deployment URI.

  • attributes (Hash)

    Attributes for bulk create.

Options Hash (attributes):

  • urlPath (String)

    URL path (“/vendor-app”) used in gateway routing data.

  • shares (Array<Hash>)

    Array of hashes. Maximum is 1000 shares per command. Keys:

    • name (String) AppShare name. May be nil.

    • code (String) AppShare code. May be nil.

    • tenantUri URI(String, UU::OS::UESURI) UESURI of the tenant. Required.

Returns:

  • (Array)

    Array of UESURIs of created AppShares.

See Also:



120
121
122
# File 'lib/uu/operation_registry/app_share.rb', line 120

def bulk_create(app_deployment_uri, attributes)
  @client.invoke(:bulkCreate, app_deployment_uri, parameters: attributes)
end

#bulk_delete(app_deployment_uri, attributes) ⇒ Array

Removes multiple shares in one command.

Parameters:

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

    app deployment URI.

  • attributes (Hash)

    Attributes for bulk delete.

Options Hash (attributes):

  • appShares (Array<String, UU::OS::UESURI>)

    Array of UESURIs of AppShares. Maximum is 1000 appShares per command.

Returns:

  • (Array)

    Array of UESURIs of removed AppShares.

See Also:



154
155
156
# File 'lib/uu/operation_registry/app_share.rb', line 154

def bulk_delete(app_deployment_uri, attributes)
  @client.invoke(:bulkDelete, app_deployment_uri, parameters: attributes)
end

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

Creates a new app share.

Parameters:

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

    App deployment URI.

  • attributes (Hash)

    AppShare attributes.

Options Hash (attributes):

  • name (String)

    AppShare name. May be nil.

  • code (String)

    AppShare code. May be nil.

  • tenantUri (UU::OS::UESURI)

    URI of the primary tenant (the “paying tenant”).

  • urlPath (String)

    URL path (“/vendor-app”) used in gateway routing data.

Returns:

  • (UU::OS::UESURI)

    UESURI of the created app share.



# File 'lib/uu/operation_registry/app_share.rb', line 25

#delete(app_share_uri) ⇒ void

This method returns an undefined value.

Deletes the specified app share from the registry.

Parameters:

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

    AppShare URI.



# File 'lib/uu/operation_registry/app_share.rb', line 71

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

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

Parameters:

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

    app deployment URI.

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

    Criteria for listing app shares.

Options Hash (criteria):

  • query (String)

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

  • pageIndex (Fixnum)

    Result set page index.

  • pageSize (Fixnum)

    Result set page size.

Returns:

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

    Paged result set.



95
96
97
# File 'lib/uu/operation_registry/app_share.rb', line 95

def get_app_share_list(app_deployment_uri, criteria = {})
  @client.invoke(:getAppShareList, app_deployment_uri, parameters: criteria)
end

#get_attributes(app_share_uri) ⇒ Hash

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

Parameters:

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

    AppShare URI.

Returns:

  • (Hash)

    AppShare attributes.



# File 'lib/uu/operation_registry/app_share.rb', line 44

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

Sets attributes of an app share.

Parameters:

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

    AppShare URI.

  • attributes (Hash)

    AppShare attributes.

Options Hash (attributes):

  • name (String)

    AppShare name. May be nil.

  • code (String)

    AppShare code. May be nil.

Returns:

  • (UU::OS::UESURI)

    UESURI of the updated app share.



# File 'lib/uu/operation_registry/app_share.rb', line 57