A "Mothership" is just another s3db deployment, where "Sattelite" deployments can register into. There are two kinds of mothership: to deliver code; to fit as a deployment discovery service. Both functionality may exist in the same mothership. To create a "MotherShip" deployment for code distribution, you will need to create: - A project - A collection in that project - 2 rules, one where the file itself will be uploaded into, one where the path where the file should go to. The Ids of there will need to be copied into your config.inc.php: (NOTE: Use the following code as example. You will need to create a user, e.g. daemon, with a key, as well as a project, a collection and two rules.)
Mothership Reference $GLOBALS['update_project']['key']='your daemon key here'; $GLOBALS['update_project']['project_id']='7'; $GLOBALS['update_project']['collection_id']='8'; $GLOBALS['update_project']['file']['rule_id']='19'; $GLOBALS['update_project']['path']['rule_id']='15';
ATTENTION: This projects needs to be made available for the user "public" such that your registered deployments may have access to the source code. If you are looking into building a mothership only as deployment registry: - Create a project - Create a collection for deployment in that project - Create a set of rules:
|
Deployment |
hasName |
name |
|
|
Deployment |
hasDescription |
description |
|
|
Deployment |
hasKeywords |
keywords |
|
|
Deployment |
hasURL |
url |
|
|
Deployment |
hasPublicKey |
publicKey |
|
|
Deployment |
belongsTo |
userName |
|
|
Deployment |
hasContact |
email |
You will need to add both the project_id and the collection_id to your config.inc.php:
Deployment mothership$GLOBALS['deployment_project']['key'] = 'your daemon key here'; $GLOBALS['deployment_project']['project_id']='12'; $GLOBALS['deployment_project']['collection_id']='65';
(Note: Don't forget to replace the ids in this example with your project and collection_id)
Querying the mothershipThe mothership or root of S3DB deployments can be used to resolve an S3DB deployment namespace within using the api function msredirect.php
msredirect.phpURI: http://root.s3db.org/msredirect.php
Arguments:name: name/title given to deployment at the time of registry) redirect: 0 does not redirect; 1 redirects to discovered uri func: apifunction that will be appended to the resolved DNS args: arguments to be appended to the apifunction indicated in 'func'; these must be url-encoded
Example: http://root.s3db.org/msredirect.php?name=TCGA&func=URI&args=uid&equal;P126
|