Vertica

Analytic database management software.

Database · Vertica

Details

IDVertica
ProviderOpenText
CategoryDatabase
From Version5.0.0
Docker Imagedemisto/py3-tools:1.0.0.114656
Supported ModulesAgentix XSIAM

README

This integration was integrated and tested with Vertica v4.1.

Configure Vertica on Cortex XSOAR

  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for Vertica.
  3. Click Add instance to create and configure a new integration instance.
    • Name: a textual name for the integration instance.
    • Host (myhost.example.com)
    • Database
    • Username
    • Port
  4. Click Test to validate the URLs, token, and connection.

Commands

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

1. Query the Vertica database


Executes a query on the Vertica database.

Base Command

vertica-query

Input
Argument Name Description Required
query A SQL query to perform on the Vertica database. Required
limit The maximum number of results to return. Optional

 

Context Output
Path Type Description
Vertica.Query string The original query.
Vertica.Row string The content of rows.

 

Command Example
!vertica-query query="SELECT * FROM system_tables ORDER BY table_schema, table_name LIMIT 5;" limit="50"
Context Example
Vertica:{} 2 items
Query:SELECT * FROM system_tables ORDER BY table_schema, table_name LIMIT 5;
Row:[] 5 items
0:{} 8 items
IsAccessibleDuringLockdown:false
IsMonitorable:true
IsSuperuserOnly:true
TableDescription:Access Policy information
TableId:95400
TableName:access_policy
TableSchema:v_catalog
TableSchemaId:8301
1:{} 8 items
IsAccessibleDuringLockdown:false
IsMonitorable:true
IsSuperuserOnly:false
TableDescription:A complete listing of all tables and views
TableId:10206
TableName:all_tables
TableSchema:v_catalog
TableSchemaId:8301
2:{} 8 items
IsAccessibleDuringLockdown:false
IsMonitorable:true
IsSuperuserOnly:false
TableDescription:Audit table for Managing_Users_And_Privileges category
TableId:10338
TableName:audit_managing_users_privileges
TableSchema:v_catalog
TableSchemaId:8301
3:{} 8 items
IsAccessibleDuringLockdown:false
IsMonitorable:true
IsSuperuserOnly:true
TableDescription:List of available branches
TableId:10800
TableName:branches
TableSchema:v_catalog
TableSchemaId:8301
4:{} 8 items
IsAccessibleDuringLockdown:false
IsMonitorable:true
IsSuperuserOnly:true
TableDescription:Current status of existing branches
TableId:117200
TableName:branches_status
TableSchema:v_catalog
TableSchemaId:8301
Human Readable Output

Configuration parameters

  • url — Host (myhost.example.com) (required)
  • database (mydb) — Database (required)
  • credentials — Username (required)
  • port — Port

Commands (1)

  • vertica-query

    Executes a query on the Vertica database.

import demistomock as demisto
from Vertica import connect_db

RETURN_ERROR_TARGET = "Vertica.return_error"


def test_connect_db_fail(mocker):
    bad_connection_params = {"credentials": {"identifier": "stam", "password": "stam"}, "database": "bad", "url": "127.0.0.1"}
    mocker.patch.object(demisto, "params", return_value=bad_connection_params)
    return_error_mock = mocker.patch(RETURN_ERROR_TARGET)
    # validate our mock of params
    assert demisto.params().get("url") == "127.0.0.1"
    connect_db()
    assert return_error_mock.call_count == 1
    # call_args last call with a tuple of args list and kwargs
    err_msg = return_error_mock.call_args[0][0]
    assert len(err_msg) < 150
    assert "Could not connect to DB" in err_msg