diff --git a/content/io/cloudslang/base/database/sql_command.sl b/content/io/cloudslang/base/database/sql_command.sl index a9a4181327..3a643af29a 100644 --- a/content/io/cloudslang/base/database/sql_command.sl +++ b/content/io/cloudslang/base/database/sql_command.sl @@ -17,12 +17,13 @@ #! #! @input db_server_name: The hostname or ip address of the database server. #! @input db_type: The type of database to connect to. -#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL' and 'Custom'. +#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL', 'Vertica' and 'Custom'. #! @input username: The username to use when connecting to the database. #! @input password: The password to use when connecting to the database. #! @input instance: The name instance (for MSSQL Server). Leave it blank for default instance. #! @input db_port: The port to connect to. -#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432'. +#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432', +#! Vertica: '5433'. #! @input database_name: The name of the database. #! @input authentication_type: The type of authentication used to access the database (applicable only to MSSQL type). #! Valid: 'sql', 'windows' @@ -55,7 +56,7 @@ #! Example: 'db.pooling.enable=true' #! @input result_set_type: The result set type. See JDBC folder description for more details. #! Valid values: 'TYPE_FORWARD_ONLY', 'TYPE_SCROLL_INSENSITIVE', 'TYPE_SCROLL_SENSITIVE'. -#! Default value: 'TYPE_SCROLL_INSENSITIVE' except DB2 which is overridden to 'TYPE_FORWARD_ONLY' +#! Default value: 'TYPE_SCROLL_INSENSITIVE' except or DB2 and Vertica which is overridden to 'TYPE_FORWARD_ONLY' #! @input result_set_concurrency: The result set concurrency. See JDBC folder description for more details. #! Valid values: 'CONCUR_READ_ONLY', 'CONCUR_UPDATABLE' #! Default value: 'CONCUR_READ_ONLY' @@ -174,7 +175,7 @@ operation: private: true java_action: - gav: 'io.cloudslang.content:cs-database:0.0.4' + gav: 'io.cloudslang.content:cs-database:0.0.5-SNAPSHOT' class_name: io.cloudslang.content.database.actions.SQLCommand method_name: execute diff --git a/content/io/cloudslang/base/database/sql_query.sl b/content/io/cloudslang/base/database/sql_query.sl index f1e1797303..a6429106e3 100644 --- a/content/io/cloudslang/base/database/sql_query.sl +++ b/content/io/cloudslang/base/database/sql_query.sl @@ -17,12 +17,13 @@ #! #! @input db_server_name: The hostname or ip address of the database server. #! @input db_type: The type of database to connect to. -#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL' and 'Custom'. +#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL', Vertica and 'Custom'. #! @input username: The username to use when connecting to the database. #! @input password: The password to use when connecting to the database. #! @input instance: The name instance (for MSSQL Server). Leave it blank for default instance. #! @input db_port: The port to connect to. -#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432'. +#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432', +#! Vertica: '5433'. #! @input database_name: The name of the database. #! @input authentication_type: The type of authentication used to access the database (applicable only to MSSQL type). #! Default: 'sql' @@ -61,7 +62,7 @@ #! Example: 'db.pooling.enable=true' #! @input result_set_type: The result set type. See JDBC folder description for more details. #! Valid values: 'TYPE_FORWARD_ONLY', 'TYPE_SCROLL_INSENSITIVE', 'TYPE_SCROLL_SENSITIVE'. -#! Default value: 'TYPE_SCROLL_INSENSITIVE' except DB2 which is overridden to 'TYPE_FORWARD_ONLY' +#! Default value: 'TYPE_SCROLL_INSENSITIVE' except for DB2 and Vertica which is overridden to 'TYPE_FORWARD_ONLY' #! @input result_set_concurrency: The result set concurrency. See JDBC folder description for more details. #! Valid values: 'CONCUR_READ_ONLY', 'CONCUR_UPDATABLE' #! Default value: 'CONCUR_READ_ONLY' @@ -202,7 +203,7 @@ operation: private: true java_action: - gav: 'io.cloudslang.content:cs-database:0.0.4' + gav: 'io.cloudslang.content:cs-database:0.0.5-SNAPSHOT' class_name: io.cloudslang.content.database.actions.SQLQuery method_name: execute diff --git a/content/io/cloudslang/base/database/sql_query_all_rows.sl b/content/io/cloudslang/base/database/sql_query_all_rows.sl index 3f36e16440..042a2268ed 100644 --- a/content/io/cloudslang/base/database/sql_query_all_rows.sl +++ b/content/io/cloudslang/base/database/sql_query_all_rows.sl @@ -17,12 +17,13 @@ #! #! @input db_server_name: The hostname or ip address of the database server. #! @input db_type: The type of database to connect to. -#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL' and 'Custom'. +#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL', 'Vertica' and 'Custom'. #! @input username: The username to use when connecting to the database. #! @input password: The password to use when connecting to the database. #! @input instance: The name instance (for MSSQL Server). Leave it blank for default instance. #! @input db_port: The port to connect to. -#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432'. +#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432', +#! Vertica: '5433'. #! @input database_name: The name of the database. #! @input authentication_type: The type of authentication used to access the database (applicable only to MSSQL type). #! Default: 'sql' @@ -62,7 +63,7 @@ #! Example: 'db.pooling.enable=true' #! @input result_set_type: The result set type. See JDBC folder description for more details. #! Valid values: 'TYPE_FORWARD_ONLY', 'TYPE_SCROLL_INSENSITIVE', 'TYPE_SCROLL_SENSITIVE'. -#! Default value: 'TYPE_SCROLL_INSENSITIVE' except DB2 which is overridden to 'TYPE_FORWARD_ONLY' +#! Default value: 'TYPE_SCROLL_INSENSITIVE' except or DB2 and Vertica which is overridden to 'TYPE_FORWARD_ONLY' #! @input result_set_concurrency: The result set concurrency. See JDBC folder description for more details. #! Valid values: 'CONCUR_READ_ONLY', 'CONCUR_UPDATABLE' #! Default value: 'CONCUR_READ_ONLY' @@ -196,7 +197,7 @@ operation: private: true java_action: - gav: 'io.cloudslang.content:cs-database:0.0.4' + gav: 'io.cloudslang.content:cs-database:0.0.5-SNAPSHOT' class_name: io.cloudslang.content.database.actions.SQLQueryAllRows method_name: execute diff --git a/content/io/cloudslang/base/database/sql_query_tabular.sl b/content/io/cloudslang/base/database/sql_query_tabular.sl index 1b994679f3..b4f1a20eab 100644 --- a/content/io/cloudslang/base/database/sql_query_tabular.sl +++ b/content/io/cloudslang/base/database/sql_query_tabular.sl @@ -17,12 +17,13 @@ #! #! @input db_server_name: The hostname or ip address of the database server. #! @input db_type: The type of database to connect to. -#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL' and 'Custom'. +#! Valid: 'Oracle', 'MSSQL', 'Sybase', 'Netcool', 'DB2', 'PostgreSQL', Vertica and 'Custom'. #! @input username: The username to use when connecting to the database. #! @input password: The password to use when connecting to the database. #! @input instance: The name instance (for MSSQL Server). Leave it blank for default instance. #! @input db_port: The port to connect to. -#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432'. +#! Default: Oracle: '1521', MSSQL: '1433', Sybase: '5000', Netcool: '4100', DB2: '50000', PostgreSQL: '5432', +#! Vertica: '5433'. #! @input database_name: The name of the database. #! @input authentication_type: The type of authentication used to access the database (applicable only to MSSQL type). #! Default: 'sql' @@ -58,7 +59,7 @@ #! Example: 'db.pooling.enable=true' #! @input result_set_type: The result set type. See JDBC folder description for more details. #! Valid values: 'TYPE_FORWARD_ONLY', 'TYPE_SCROLL_INSENSITIVE', 'TYPE_SCROLL_SENSITIVE'. -#! Default value: 'TYPE_SCROLL_INSENSITIVE' except DB2 which is overridden to 'TYPE_FORWARD_ONLY' +#! Default value: 'TYPE_SCROLL_INSENSITIVE' except or DB2 and Vertica which is overridden to 'TYPE_FORWARD_ONLY' #! @input result_set_concurrency: The result set concurrency. See JDBC folder description for more details. #! Valid values: 'CONCUR_READ_ONLY', 'CONCUR_UPDATABLE' #! Default value: 'CONCUR_READ_ONLY' @@ -178,7 +179,7 @@ operation: private: true java_action: - gav: 'io.cloudslang.content:cs-database:0.0.4' + gav: 'io.cloudslang.content:cs-database:0.0.5-SNAPSHOT' class_name: io.cloudslang.content.database.actions.SQLQueryTabular method_name: execute diff --git a/test/io/cloudslang/base/database/test_vertica.inputs.yaml b/test/io/cloudslang/base/database/test_vertica.inputs.yaml new file mode 100644 index 0000000000..f7ea914289 --- /dev/null +++ b/test/io/cloudslang/base/database/test_vertica.inputs.yaml @@ -0,0 +1,27 @@ + +# (c) Copyright 2014-2017 EntIT Software LLC, a Micro Focus company, L.P. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License v2.0 which accompany this distribution. +# +# The Apache License is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +######################################################################################################################## + +testVertica: + testSuites: [vertica] + testFlowPath: io.cloudslang.base.database.test_vertica + inputs: + - db_server_name: + - username: + - password: + - database_name: + outputs: + - return_result: "Command completed successfully" + result: SUCCESS diff --git a/test/io/cloudslang/base/database/test_vertica.sl b/test/io/cloudslang/base/database/test_vertica.sl new file mode 100644 index 0000000000..783db2dc5d --- /dev/null +++ b/test/io/cloudslang/base/database/test_vertica.sl @@ -0,0 +1,180 @@ +namespace: io.cloudslang.base.database + +imports: + db: io.cloudslang.base.database + strings: io.cloudslang.base.strings + +flow: + name: test_vertica + + inputs: + - db_server_name + - db_port: + required: false + default: "5433" + - username + - password: + sensitive: true + - database_name + + outputs: + - return_result + - output_text + + workflow: + + - clean_up_old_table_ignore_errors: + do: + io.cloudslang.base.database.sql_command: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'DROP TABLE TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_create_table + - FAILURE: sql_create_table + + - sql_create_table: + do: + io.cloudslang.base.database.sql_command: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'CREATE TABLE TestCsTickStore (ts TIMESTAMP, symbol VARCHAR(8), bid FLOAT);' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_insert_row + - FAILURE: CREATE_STACK_FAILURE + + - sql_insert_row: + do: + io.cloudslang.base.database.sql_command: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: "INSERT INTO TestCsTickStore VALUES ('2018-01-01 03:00:00', 'XYZ', 10.0);" + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_select_count + - FAILURE: CREATE_STACK_FAILURE + + - sql_select_count: + do: + io.cloudslang.base.database.sql_command: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'SELECT COUNT(*) FROM TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_query_all + - FAILURE: CREATE_STACK_FAILURE + + - sql_query_all: + do: + io.cloudslang.base.database.sql_query_all_rows: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'SELECT * FROM TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_query_tabular + - FAILURE: CREATE_STACK_FAILURE + + + - sql_query_tabular: + do: + io.cloudslang.base.database.sql_query_tabular: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'SELECT * FROM TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: sql_query + - FAILURE: CREATE_STACK_FAILURE + + + - sql_query: + do: + io.cloudslang.base.database.sql_query: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - key: key + - command: 'SELECT * FROM TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + - rows_left: ${rows_left} + - column_names: ${column_names} + + navigate: + - HAS_MORE: sql_drop_table + - NO_MORE: sql_drop_table + - FAILURE: CREATE_STACK_FAILURE + + + - sql_drop_table: + do: + io.cloudslang.base.database.sql_command: + - db_server_name: ${db_server_name} + - db_port: ${db_port} + - db_type: Vertica + - username: ${username} + - password: ${password} + - database_name: ${database_name} + - command: 'DROP TABLE TestCsTickStore;' + - trust_all_roots: 'true' + publish: + - output_text: ${output_text} + - return_result: ${return_result} + navigate: + - SUCCESS: SUCCESS + - FAILURE: CREATE_STACK_FAILURE + + results: + - SUCCESS + - CREATE_STACK_FAILURE