Team Development in 4.1
NodeJS Admin Command Line
The NodeJS tool used by devops to connect to LAC and export/import is called lacadmin (see documentation) . The original command used to import and export API [lacadmin project export] has been deprecated (it will still work but uses the 4.0 style) and replaced with [lacadmin api export] and [lacadmin api import]. The new 'api' command uses the new @export and @import endpoints. These have a number of new arguments shown below: (see documentation)
Usage: API [options] <list|create|update|delete|use|import|export|extract>
Administer APIs. Actions are: list, create, update, delete, use, export
-h, --help output usage information
--ident [ident] The ident of the specific API (see: lacadmin api list).
--api_name [name] The name of the API. --url_name [name] The url fragment name of the API.
--status [status] optional: create or update the status of the API, can be A (for Active) or I for (Inactive).
--authprovider [ident] optional: create or update the ident of the authentication provider for the API.
--comments [comments] optional: create or update a description of the API.
--section [name] optional: Export Only -The named section of the API you wish to export (e.g. resources, functions, datasources).
--section_filter [filter] optional: Export Only -The section filter of the API you wish to export (name=foo&version=v1).
-d, --directory [directory] Required for extract, the name of a directory to extract ZIP files.
-f, --file [file] optional: for import/export/extract, the name of a file to read from/save to, if unspecified, use stdin/stdout.
--format [json|zip] optional: for import/export, this sets the output type of the export default: json.
--namecollision [fail|rename_new|replace_existing|disable_and_rename_existing] optional: for import, determines how to handle existing API projects(default rename_new).
--errorhandling [standard|fail_on_warning|best_efforts] optional: for import, sets the error level response handling (default: standard.
--passwordstyle [skip|encrypted|plaintext] optional: for export, sets the password style of exported API datasources (default: skip).
--librarystyle [emit_all|in_use_only] optional: for export, sets the library style (default: emit_all).
--apioptionsstyle [emit_all|skip_default] optional: for export, sets the api options (default: emit_all).
--synchronize [replace|merge] optional: Export only- Used only by extract to synchronize zip file with directory folder (default: merge) replace will remove root directory contents and replace with zip contents.
-v, --verbose optional: whether to display detailed results, or just a summary.
One of the features above is called 'section' which allows the export of a single sub-directory (lacadmin api export --section resources). Which can be further reduced down to a specific named object using the 'section_filter' (lacadmin api export --section resources --section_filter "name=AllCustomers"). Examples for each can be found here.
One of the new features of the lacadmin command line tool allows the devops person to export the entire content of a TeamSpace (this is a new concept in 4.1 found here). This will export the entire set of API's for the TeamSpace user into a single ZIP file (which can then be imported into another TeamSpace or LAC Server).
$lacadmin login -u admin -p Password1 http://localhost:8080 -a jetty
$lacadmin use jetty
$lacadmin teamspace exportRepos --file ALL_PROJECTS.zip --format zip --passwordstyle encrypted
#Create a new TeamSpace for a user: dev1 password mypassw
$lacadmin login -u dev1 -p mypassw http://localhost:8080 -a qa
$lacadmin use qa
$lacadmin api import --file ALL_PROJECTS.zip --namecollision replace_existing