Mako Command Line Utilities Reference
The command line utilities are located in the /scripts directory. Each uses the
Mako API to implement common Mako functionality. All of the command line tools that
run during service uptime take a -factory
argument that allows you to specify the factory class that will be used to get handles
to Mobius network services. Omitting this flag will cause the tools to use the default
factory for handles.
Each of these will also take a -factoryXML argument that specifies the path
to a Grid Service Factory configuration file, an
example of which is given here.
Passing the -help argument will list
the utility's required and optional arguments.
Scripts ending .bat are for Windows, .sh for *nix.
- Start a Mako
-
Starts a Mako server, parsing the config file passed in.
Starting a Mako is a generic action, the specifics of which are determined by
your config file.
Script name:startMako
Arguments:
Path to config file (required) - Create a Collection
-
This script adds a collection to the data service.
Script name:createCollection
Arguments:
-collectionName of collection (required)
-servicesList of data services to create the collection on (required) - Submit a Schema
-
This script submits an XML Schema to a Mako.
Script name:submitSchema
Arguments:
-collectionCollection the schema belongs to (required)
-xsdSchema file name (required)
-servicesService IDs of the Makos to send the schema to (required) - Submit Multiple Schemata
-
This script allows for batch submission of XML Schemata to a Mako.
Script name:submitSchemata
Arguments:
-collectionCollection to submit schemata to (required)
-fileSchema file name to be added
-serviceService ID of the Mako to send the schemata to (required)-directoryPath to a directory containing.xsdschema descriptions to be added - Submit XML
-
This script allows the submission of an XML document or a directory of XML documents
to a collection existing on a Mako.
Script name:submitXML
Arguments:
-collectionThe collection to sumbit XML to (required)
-fileA single XML file to sumbit
-serviceThe service ID of the Mako (required)
-directoryA directory full of XML files to sumbit - Submit an XPath Query
-
This script allows the execution of a XPath query on an XML collection within a Mako. The
script allows you to specify how many levels of XML data to return. For example
specifying 2 levels will return the root node and the root nodes children with a pointer to the
root node's children's children. Specifying a level of 0 will return pointers or references to
all the documents satisfying the query. The pointers can later be used to materialize the results.
materializerefers to the documents in a Mako which are lazy loaded. They can be either materialized (displayed in full content) or lower levels can be represented by "DocumentReferences". A DocumentReference is a pointer to the actual document. It requires less overhead to return than the actual document.levelstakes an integer and represents the number of levels below the root (target of the XPath) you wish to materialize.
Script name:submitXPath
Arguments:
-collectionThe collection to use (required)
-materializeWhether or not to materialize included XML (trueorfalse)
-levelsHow many levels of includes to materialize
-fileAn XPath file
-serviceThe service id of the Mako (required)
-queryAn XPath query
-namespacesA list ofprefix=namespacedefinitions which define the prefixes you can use in XPath elements
-defaultNamespaceThe namespace to use when no prefix is used for an XPath element - Modify Existing XML
-
Using the XUpdate language, the XML in the database can be modified.
The most flexible way to use this command is pass in the query via the file
flag and put the query into a seperate file. Note: The rename command and the
comment node type are not supported.
Script name:submitXUpdate
Arguments:
-collectionThe collection name (required)
-fileAn XUpdate file
-serviceThe service ID of the Mako (required)
-queryAn XUpdate statement - Remove a Schema
- Schema removal is not supported, as schemas are built into the database. To remove a schema, you must remove the collection and recreate it fresh with the new schema.
- List Collections
-
Prints out a list of the collections on the specified data service.
Script name:getCollectionList
Arguments:
-collectionName of the parent collection
-serviceService ID of the Mako to get the collection list from (required) - Retrieve Schema
-
Prints a list of schemas supported in the specified collection.
Script name:getSchemaList
Arguments:
-collectionThe name of the collection (required)
-serviceThe ID of the Mako service (required) - Retrieve XML Documents
-
This script retrieves XML documents or references to XML documents from a collection
on a specified Mako.
The script allows you to specify how many levels of XML documents to return. For example
specifying 2 levels will return the root document and the root document's children with a pointer to the
root document's children's children. Specifying a level of 0 will return pointers or references to
all the documents requested. The pointers can later be used to materialize (display full contents of)
these documents.
Documents can be
either materialized or be represented by
"DocumentReferences".
A DocumentReference is a pointer to the actual document. It requires less
overhead to return than the actual document.
levelstakes an integer and represents the number of levels below the root document you wish to materialize.
Script name:retrieveXML
Arguments:
-collectionThe name of the collection (required)
-materializeMaterialize the returned XML documents (trueorfalse)
-levelsHow many levels of documents to materialize
-serviceThe ID of the Mako service (required)
-xmlidsThe IDs of the XML document(s) to retrieve (required) - Submit and Retrieve XML
-
In a single command, this script submits a number of XML documents
and then retrieves all of them.
Script name:submitAndRetrieve
Arguments:
-collectionThe collection to submit documents to (required)
-outfileA path to an output file or directory (required)
-serviceThe service ID of the Mako (required)
-timesThe number of times to retreive the submitted documents (required)
-directoryThe directory containing the XML documents to submit (required)
- Retrieve Service Information
-
Prints the service data of the data service specified.
Script name:getServiceData
Arguments:
-onlyXMLReturn the raw XML with no formatting (trueorfalse)
-serviceThe service ID of the Mako (required) - Remove a Collection
-
Removes a collection and all of its data from the data service.
Script name:removeCollection
Arguments:
-collectionThe collection to remove (required)
-serviceService ID(s) of the Mako(s) (required) - Remove XML
-
Clears a collection of the specified items, whether they are docIds or XPaths. The
waitboolean ensures proper removal occurs because it waits for the database to do the actual data removal.
Script name:removeXML
Arguments:
-collectionThe collection to remove documents from (required)
-docsDocument Ids to remove
-serviceThe service ID of the Mako (required)
-xpathXpath by which documents will be removed
-waitWait for each document to be removed (trueorfalse) (required)-namespacesA list ofprefix=namespacedefinitions which define the prefixes you can use in XPath elements
-defaultNamespaceThe namespace to use when no prefix is used for an XPath element - Make a Configuration File
-
A replacement script that changes the localhost config files into the config file of the same
type with the appropriate dataservices changed.
Script name:makoConfigurationMaker
Arguments:
-templateThe template configuration file to build from. (required)
-outputDirectory to write new config files into
-hostsHostnames to make config files for (required) - Destroy a Mako
-
Destroys a specified Mako or list of Makos, killing the processes and
removing database schemata.
Script name:destroyMako
Arguments:
-servicesThe service IDs of Makos to destroy (required)