blob: 2c5d9c51b7ac8acc73639407d7bed1f8bbaa836f [file] [log] [blame]
FalconCLI is a interface between user and Falcon. It is a command line utility provided by Falcon. FalconCLI supports Entity Management, Instance Management and Admin operations.There is a set of web services that are used by FalconCLI to interact with Falcon.
---++Entity Management Operations
Submit option is used to set up entity definition.
$FALCON_HOME/bin/falcon entity -submit -type cluster -file /cluster/definition.xml
Note: The url option in the above and all subsequent commands is optional. If not mentioned it will be picked from file. If the option is not provided and also not set in, Falcon CLI will fail.
Once submitted, an entity can be scheduled using schedule option. Process and feed can only be scheduled.
$FALCON_HOME/bin/falcon entity -type [process|feed] -name <<name>> -schedule
$FALCON_HOME/bin/falcon entity -type process -name sampleProcess -schedule
Suspend on an entity results in suspension of the oozie bundle that was scheduled earlier through the schedule function. No further instances are executed on a suspended entity. Only schedule-able entities(process/feed) can be suspended.
$FALCON_HOME/bin/falcon entity -type [feed|process] -name <<name>> -suspend
Puts a suspended process/feed back to active, which in turn resumes applicable oozie bundle.
$FALCON_HOME/bin/falcon entity -type [feed|process] -name <<name>> -resume
Delete removes the submitted entity definition for the specified entity and put it into the archive.
$FALCON_HOME/bin/falcon entity -type [cluster|feed|process] -name <<name>> -delete
Entities of a particular type can be listed with list sub-command.
$FALCON_HOME/bin/falcon entity -type [cluster|feed|process] -list
Update operation allows an already submitted/scheduled entity to be updated. Cluster update is currently
not allowed.
$FALCON_HOME/bin/falcon entity -type [feed|process] -name <<name>> -update [-effective <<effective time>>]
Status returns the current status of the entity.
$FALCON_HOME/bin/falcon entity -type [cluster|feed|process] -name <<name>> -status
With the use of dependency option, we can list all the entities on which the specified entity is dependent. For example for a feed, dependency return the cluster name and for process it returns all the input feeds, output feeds and cluster names.
$FALCON_HOME/bin/falcon entity -type [cluster|feed|process] -name <<name>> -dependency
Definition option returns the entity definition submitted earlier during submit step.
$FALCON_HOME/bin/falcon entity -type [cluster|feed|process] -name <<name>> -definition
---++Instance Management Options
Kill sub-command is used to kill all the instances of the specified process whose nominal time is between the given start time and end time.
1. For all the instance management sub-commands, if end time is not specified, Falcon will perform the actions on all the instances whose instance time falls after the start time.
2. The start time and end time needs to be specified in TZ format.
Example: 01 Jan 2012 01:00 => 2012-01-01T01:00Z
3. Process name is compulsory parameter for each instance management command.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -kill -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Suspend is used to suspend a instance or instances for the given process. This option pauses the parent workflow at the state, which it was in at the time of execution of this command.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -suspend -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Continue option is used to continue the failed workflow instance. This option is valid only for process instances in terminal state, i.e. SUCCEDDED, KILLED or FAILED.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -re-run -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Rerun option is used to rerun instances of a given process. This option is valid only for process instances in terminal state, i.e. SUCCEDDED, KILLED or FAILED. Optionally, you can specify the properties to override.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -re-run -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'" [-file <<properties file>>]
Resume option is used to resume any instance that is in suspended state.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -resume -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Status option via CLI can be used to get the status of a single or multiple instances. If the instance is not yet materialized but is within the process validity range, WAITING is returned as the state. Along with the status of the instance time is also returned. Log location gives the oozie workflow url
If the instance is in WAITING state, missing dependencies are listed
Example : Suppose a process has 3 instance, one has succeeded,one is in running state and other one is waiting, the expected output is:
{"status":"SUCCEEDED","message":"getStatus is successful","instances":[{"instance":"2012-05-07T05:02Z","status":"SUCCEEDED","logFile":"http://oozie-dashboard-url"},{"instance":"2012-05-07T05:07Z","status":"RUNNING","logFile":"http://oozie-dashboard-url"}, {"instance":"2010-01-02T11:05Z","status":"WAITING"}]
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -status -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Summary option via CLI can be used to get the consolidated status of the instances between the specified time period.
Each status along with the corresponding instance count are listed for each of the applicable colos.
The unscheduled instances between the specified time period are included as UNSCHEDULED in the output to provide more clarity.
Example : Suppose a process has 3 instance, one has succeeded,one is in running state and other one is waiting, the expected output is:
{"status":"SUCCEEDED","message":"getSummary is successful", "cluster": <<name>> [{"SUCCEEDED":"1"}, {"WAITING":"1"}, {"RUNNING":"1"}]}
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -summary -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Running option provides all the running instances of the mentioned process.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -running
Get logs for instance actions
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -logs -start "yyyy-MM-dd'T'HH:mm'Z'" [-end "yyyy-MM-dd'T'HH:mm'Z'"] [-runid <<runid>>]
Describes list of life cycles of a entity , for feed it can be replication/retention and for process it can be execution.
This can be used with instance management options. Default values are replication for feed and execution for process.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -status -lifecycle <<lifecycletype>> -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
Displays the workflow params of a given instance. Where start time is considered as nominal time of that instance.
$FALCON_HOME/bin/falcon instance -type <<feed/process>> -name <<name>> -params -start "yyyy-MM-dd'T'HH:mm'Z'"
---++ Graphs Options
---+++ Vertex
Get the vertex with the specified id.
$FALCON_HOME/bin/falcon graph -vertex -id <<id>>
$FALCON_HOME/bin/falcon graph -vertex -id 4
---+++ Vertices
Get all vertices for a key index given the specified value.
$FALCON_HOME/bin/falcon graph -vertices -key <<key>> -value <<value>>
$FALCON_HOME/bin/falcon graph -vertices -key type -value feed-instance
---+++ Vertex Edges
Get the adjacent vertices or edges of the vertex with the specified direction.
$FALCON_HOME/bin/falcon graph -edges -id <<vertex-id>> -direction <<direction>>
$FALCON_HOME/bin/falcon graph -edges -id 4 -direction both
$FALCON_HOME/bin/falcon graph -edges -id 4 -direction inE
---+++ Edge
Get the edge with the specified id.
$FALCON_HOME/bin/falcon graph -edge -id <<id>>
$FALCON_HOME/bin/falcon graph -edge -id Q9n-Q-5g
---++Admin Options
$FALCON_HOME/bin/falcon admin -help
Version returns the current version of Falcon installed.
$FALCON_HOME/bin/falcon admin -version
Status returns the current state of Falcon (running or stopped).
$FALCON_HOME/bin/falcon admin -status