Terminal View

In response of the great interest related to Shellshock, Dirigible provided several possibilities to use low level OS commands.

After going to the well known trial instance at http://trial.dirigible.io from the menu, go to Window->Show View->Other open the Other tree-node and choose Terminal.

/wp-content/uploads/2014/10/open_view_563799.png

/wp-content/uploads/2014/10/show_view_563800.png

You can use the line at the bottom to enter a shell command. It is obviously dependent on the operating system, hence the format is for:

Linux:           bash -c “ps -ef|grep java”

Windows:     cmd /c “dir”

/wp-content/uploads/2014/10/terminal_full_563590.png

There is a default time-out limit once reached the execution of the command will be stopped. If you want to change this limit go to Window->Preferences->Terminal

/wp-content/uploads/2014/10/terminal_prefs_563883.png

Command Services

When the initial excitement from playing with the first few shell commands you remember passes, probably you will ask: Why the heck I need a terminal view in a cloud toolkit, which proclaims the In-System Programming and Content-Centric concepts? Isn’t it everything text based artifacts contained in a repository and executed by the built-in containers? Why I need OS access?

Yes. You do not need it… unless something exceptional happens or you need to integrate in your cloud application exactly a shell command. One prominent use case could be to integrate a new yet cool framework, which currently is not and will not be soon a part of Dirigible standard delivery.

To do this, you can create a Scripting Service following the standard way by choosing the “Terminal Command” template.

/wp-content/uploads/2014/10/command_service_select_563868.png

The default template of a command returns the system information and has Linux and Windows variants:


{
    "description":"test command printing the os name and version",
    "contentType":"plain/text",
    "useContent":"false",
    "workDir":".",
    "commands":
        [
            {
                "osName": "Linux",
                "command":"bash -c \"cat /proc/version\""
            }
            ,
            {
                "osName": "Windows",
                "command":"cmd /c \"systeminfo\""
            }
        ],
    "envAdd":
        [
            {
            "name":"java.env1",
                "value":"toBeAdded"
            }
        ],
    "envRemove":
        [
            {
                "name":"java.env2"
            }
        ]
}

Once you Activate it, you can immediately test – click on it and see the result in the preview window:

/wp-content/uploads/2014/10/command_exec_563882.png

As you can see the terminal commands follow the same paradigm as the other scripting services as well as have remotely accessible endpoints constructed by the well known pattern.

http(s)://[host]:[port]/dirigible/command/[project_name]/[command_name].command

Do you have already a plan for your next “native” service?

Enjoy!

References:

The project site: http://www.dirigible.io

The source code is available at GitHub – http://github.com/SAP/cloud-dirigible

Forum: http://forum.dirigible.io

Twitter: https://twitter.com/dirigible_io

Youtube: https://www.youtube.com/channel/UCYnsiVQ0M9iQLqP5DXCLMBA/

Help: http://help.dirigible.io

Samples: http://samples.dirigible.io

Google Group: https://plus.google.com/111171361109860650442/posts

Blog: http://dirigible-logbook.blogspot.com/

Dirigible on SAP HANA Cloud Platform

Dirigible – Extensions vs Configurations

Dirigible is the fast track to your HCP HANA DB instance

Dirigible – To Replicate or Not To Replicate

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply