Skip to content

Console client

You can talk to a Hawk server from one of the console client products in the download page for Hawk. Using the product only requires unpacking the product and running the main executable within it. Alternatively, you could install the "Hawk CLI Feature" into your Eclipse instance and use these commands from the "Host OSGi Console" in the Console view.

Each Thrift API has its own set of commands.

Hawk

You can use the hawkHelp command to list all the available commands.

Connecting to Hawk

Name Description
hawkConnect <url> [username] [password] Connects to a Thrift endpoint (guesses the protocol from the URL)
hawkDisconnect Disconnects from the current Thrift endpoint

Managing Hawk indexer instances

Name Description
hawkAddInstance <name> <backend> [minDelay] [maxDelay|0] Adds an instance with the provided name (if maxDelay = 0, periodic updates are disabled)
hawkListBackends Lists the available Hawk backends
hawkListInstances Lists the available Hawk instances
hawkRemoveInstance <name> Removes an instance with the provided name, if it exists
hawkSelectInstance <name> Selects the instance with the provided name
hawkStartInstance <name> Starts the instance with the provided name
hawkStopInstance <name> Stops the instance with the provided name
hawkSyncInstance <name> [waitForSync:true|false] Requests an immediate sync on the instance with the provided name

Managing metamodels

Name Description
hawkListMetamodels Lists all registered metamodels in this instance
hawkRegisterMetamodel <files...> Registers one or more metamodels
hawkUnregisterMetamodel <uri> Unregisters the metamodel with the specified URI

Managing version control repositories

Name Description
hawkAddRepository <url> <type> [user] [pwd] Adds a repository
hawkListFiles <url> [filepatterns...] Lists files within a repository
hawkListRepositories Lists all registered metamodels in this instance
hawkListRepositoryTypes Lists available repository types
hawkRemoveRepository <url> Removes the repository with the specified URL
hawkUpdateRepositoryCredentials <url> <user> <pwd> Changes the user/password used to monitor a repository

Querying models

Name Description
hawkGetModel <repo> [filepatterns...] Returns all the model elements of the specified files within the repo
hawkGetRoots <repo> [filepatterns...] Returns only the root model elements of the specified files within the repo
hawkListQueryLanguages Lists all available query languages
hawkQuery <query> <language> [repo] [files] Queries the index
hawkResolveProxies <ids...> Retrieves model elements by ID

Managing derived attributes

Name Description
hawkAddDerivedAttribute <mmURI> <mmType> <name> <type> <lang> <expr> [many|ordered|unique]* Adds a derived attribute
hawkListDerivedAttributes Lists all available derived attributes
hawkRemoveDerivedAttribute <mmURI> <mmType> <name> Removes a derived attribute, if it exists

Managing indexed attributes

Name Description
hawkAddIndexedAttribute <mmURI> <mmType> <name> Adds an indexed attribute
hawkListIndexedAttributes Lists all available indexed attributes
hawkRemoveIndexedAttribute <mmURI> <mmType> <name> Removes an indexed attribute, if it exists

Watching over changes in remote models

Name Description
hawkWatchModelChanges [default|temporary|durable] [client ID] [repo] [files...] Watches an Artemis message queue with detected model changes

Users

The Users API has its own set of commands, which can be listed through usersHelp:

Name Description
usersHelp Lists all the available commands for Users
usersConnect <url> [username] [password] Connects to a Thrift endpoint
usersDisconnect Disconnects from the current Thrift endpoint
usersAdd <username> <realname> <isAdmin: true|false> [password] Adds the user to the database
usersUpdateProfile <username> <realname> <isAdmin: true|false> Changes the personal information of a user
usersUpdatePassword <username> [password] Changes the password of a user
usersRemove <username> Removes a user
usersCheck <username> [password] Validates credentials