You can talk to a Hawk server from one of the console client products in the latest release. 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

NameDescription
hawkConnect <url> [username] [password]Connects to a Thrift endpoint (guesses the protocol from the URL)
hawkDisconnectDisconnects from the current Thrift endpoint

Managing Hawk indexer instances

NameDescription
hawkAddInstance <name> <backend> [minDelay] [maxDelay|0]Adds an instance with the provided name (if maxDelay = 0, periodic updates are disabled)
hawkListBackendsLists the available Hawk backends
hawkListInstancesLists 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

NameDescription
hawkListMetamodelsLists 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

NameDescription
hawkAddRepository <url> <type> [user] [pwd]Adds a repository
hawkListFiles <url> [filepatterns...]Lists files within a repository
hawkListRepositoriesLists all registered metamodels in this instance
hawkListRepositoryTypesLists 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

NameDescription
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
hawkListQueryLanguagesLists all available query languages
hawkQuery <query> <language> [repo] [files]Queries the index
hawkResolveProxies <ids...>Retrieves model elements by ID

Managing derived attributes

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

Managing indexed attributes

NameDescription
hawkAddIndexedAttribute <mmURI> <mmType> <name>Adds an indexed attribute
hawkListIndexedAttributesLists all available indexed attributes
hawkRemoveIndexedAttribute <mmURI> <mmType> <name>Removes an indexed attribute, if it exists

Watching over changes in remote models

NameDescription
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:

NameDescription
usersHelpLists all the available commands for Users
usersConnect <url> [username] [password]Connects to a Thrift endpoint
usersDisconnectDisconnects 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