Class: UU::C3::ResourceGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/uu/c3/resource_group.rb

Overview

Client of service providing operations for self-service deployment of uuApps.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session = nil) ⇒ ResourceGroup

Creates a new instance of ResourceGroup.

Parameters:

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

    Instance of session representing authenticated user (can be obtained with OS::Swecurity::Session#current_session method).



35
36
37
# File 'lib/uu/c3/resource_group.rb', line 35

def initialize(session = nil)
  @client = UU::OS::CMD::CommandClient.new(PATH, session)
end

Class Method Details

.swap(resource_group_uri) ⇒ Object

Note:

This command expects that all applications in all ResourcePools of this ResourceGroup are deployed in both slots and are prepared for AppDeployment#swap. I.e. they are properly scaled.

Note:

Ignores applications in UNDEPLOYED state.

Note:

This command cannot be called unless there is a slotMapping attribute set on ResourceGroup. The value is irrelevant as long as it is not nil.

Note:

Don’t call any other commands which causes updates (i.e. deploy, undeploy, redeploy, share, unshare, scale) until asynchronous part of this command finishes.

Note:

The applications are first swapped in uuCloudg01OperationRegistry and all the gateways are updated at the end at once. So until the command finishes the applications might not be available.

Swaps all applications in all ResourcePools of this ResourceGroup between PRODUCTION and BETA slots.

Parameters:

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

    URI of ResourceGroup.



68
69
70
# File 'lib/uu/c3/resource_group.rb', line 68

def self.swap(resource_group_uri)
  self.new(UU::OS::Security::Session.current_session).swap(resource_group_uri)
end

Instance Method Details

#swap(resource_group_uri) ⇒ UU::OS::Lang::Future

Note:

This command expects that all applications in all ResourcePools of this ResourceGroup are deployed in both slots and are prepared for AppDeployment#swap. I.e. they are properly scaled.

Note:

Ignores applications in UNDEPLOYED state.

Note:

This command cannot be called unless there is a slotMapping attribute set on ResourceGroup. The value is irrelevant as long as it is not nil.

Note:

Don’t call any other commands which causes updates (i.e. deploy, undeploy, redeploy, share, unshare, scale) until asynchronous part of this command finishes.

Note:

The applications are first swapped in uuCloudg01OperationRegistry and all the gateways are updated at the end at once. So until the command finishes the applications might not be available.

Swaps all applications in all ResourcePools of this ResourceGroup between PRODUCTION and BETA slots.

Parameters:

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

    URI of ResourceGroup.

Returns:

  • (UU::OS::Lang::Future)

    Future instance. Make sure than asynchronous part ends successfully.



52
53
54
# File 'lib/uu/c3/resource_group.rb', line 52

def swap(resource_group_uri)
  @client.invoke(:swap, resource_group_uri, parameters: {})
end