Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note

This page is under construction.

WSO2 CC exposes a service which has the following interface.:

Code Block
languagejava
public interface CloudControllerService {
    public CartridgeInfo getCartridgeInfo(String cartridgeType) throws UnregisteredCartridgeException;
    public int getPendingInstanceCount(String domainName, String subDomainName);
    public String[] getRegisteredCartridges();
    public boolean registerService(String domain, String subDomain, String tenantRange, String cartridgeType,
        String hostName, Properties properties, byte[] payload) throws UnregisteredCartridgeException;
    public String startInstance(String domainName, String subDomainName);
    public boolean terminateAllInstances(String domainName, String subDomainName);
    public boolean terminateInstance(String domainName, String subDomainName);
    public boolean terminateLastlySpawnedInstance(String domainName, String subDomainName);
    public boolean unregisterService(String domain, String subDomain) throws UnregisteredServiceException;
}

...

Function Description

Click the respective function link to learn more on its functionality.

Anchor
getCartridgeInfo

...

getCartridgeInfo

getCartridgeInfo

Code Block
languagejava
public CartridgeInfo getCartridgeInfo(String cartridgeType) throws UnregisteredCartridgeException;
Method description 

Calling this method will return information on the given cartridge if present, otherwise this will return a null value.   

...

Exception Thrown

Description

UnregisteredCartridgeException

Occurs when the cartridge type requested by this service is not registered.

Anchor
getPendingInstanceCount

...

getPendingInstanceCount

getPendingInstanceCount

Code Block
languagejava
public int getPendingInstanceCount(String domainName, String subDomainName);

...

Return Value

Description

int

The number of pending instances for this domain is returned. This will return zero if there are no instances for this domain.

Anchor
getRegisteredCartridges

...

getRegisteredCartridges

getRegisteredCartridges

Code Block
languagejava
public String[] getRegisteredCartridges();
Method

...

description  

Calling

...

this

...

method

...

will

...

result

...

in

...

returning

...

the

...

types

...

of

...

Cartridges

...

registered

...

in

...

the

...

Cloud

...

Controller.

...


Return value description

Return Value

Description

String

This will return an array containing the types of registered cartridges.

...

Anchor
#registerService
#registerService

registerService

Code Block
languagejava
public boolean registerService(String domain, String subDomain, String tenantRange, String cartridgeType,
        String hostName, Properties properties, byte[] payload) throws UnregisteredCartridgeException;
Method description  

A service cluster is uniquely identified by it's domain and sub-domain combination. This method registers the details of a newly created service cluster and it will override any existing service clusters.


Parameter description
ParameterDescription
domain
Service cluster domain.
subDomain
Service cluster sub-domain.
tenantRange
Tenant range (for example: '1-10' or '2').
cartridgeType

The registered cartridge type of the new service.

hostName
Host name of this service instance.
properties
Set of properties related to this service definition.
payload

The payload that is passed to the instance the instance to be started. Payload shouldn't The payload should not contain XML tags.


Return value description

...

Exception Thrown

Description

UnregisteredCartridgeException

Occurs when the cartridge type requested by this service is not registered.

...

Anchor
#startInstance
#startInstance

startInstance

Code Block
languagejava
public String startInstance(String domainName, String subDomainName);
Method description  

An instance belonging to the provided service domain will be started up upon calling this method.  

...

Return Value

Description

String     

The public IP which is associated with the newly started instance will be returned.

Anchor
terminateAllInstances

...

terminateAllInstances

terminateAllInstances

Code Block
languagejava
public boolean terminateAllInstances(String domainName, String subDomainName);
Method

...

description  

Calling this method will result in the termination of all instances belonging to the provided service domain and sub-domain. 

...

Return Value

Description

boolean

"True" or "false" will be returned to indicate whether all the instances were terminated successfully or not.

Anchor
terminateInstance

...

terminateInstance

terminateInstance

Code Block
languagejava
public boolean terminateInstance(String domainName, String subDomainName);
Method description 

Calling this method results in the termination of an instance belonging to the provided service domain and sub-domain .

...

Return Value

Description

boolean

"True" or "false" will be returned to indicate whether an instance was terminated successfully or not.

Anchor
terminateLastlySpawnedInstance

...

terminateLastlySpawnedInstance

terminateLastlySpawnedInstance

Code Block
languagejava
public boolean terminateLastlySpawnedInstance(String domainName, String subDomainName);
Method description  

Calling this method will result in the termination of the lastly spawned instance that belongs to the service domain and sub-domain provided .

...

Return Value

Description

boolean

"True" or "false" will be returned to indicate whether the termination was successfully or not.

Anchor
unregisterService

...

unregisterService

unregisterService

Code Block
languagejava
 public boolean unregisterService(String domain, String subDomain) throws UnregisteredServiceException;
Method description  

Calling this method will result in deregistering the service cluster that is represented by the mentioned domain and sub-domain   . 

...