Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage_type to get_tasks and get_configs #1466

Merged
merged 3 commits into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Added TLS certificates to the asset management.
[#1455](https://github.com/greenbone/gsa/pull/1455),
[#1461](https://github.com/greenbone/gsa/pull/1461)
- Add usage type to task and scanconfig commands [#1467](https://github.com/greenbone/gsa/pull/1467)
- Add usage type to task and scanconfig commands [#1460](https://github.com/greenbone/gsa/pull/1460)
[#1466](https://github.com/greenbone/gsa/pull/1466) [#1467](https://github.com/greenbone/gsa/pull/1467)

### Changed
- Modified the BarChart's y-domain to avoid range [0,0]. [#1447](https://github.com/greenbone/gsa/pull/1447)
Expand Down
25 changes: 23 additions & 2 deletions gsad/src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3028,11 +3028,14 @@ char *
get_tasks_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
const char *schedules_only, *ignore_pagination;
const char *schedules_only, *ignore_pagination, *usage_type;
gmp_arguments_t *arguments;

schedules_only = params_value (params, "schedules_only");
ignore_pagination = params_value (params, "ignore_pagination");
usage_type = params_value (params, "usage_type");
if (params_given (params, "usage_type"))
CHECK_VARIABLE_INVALID (usage_type, "Get Tasks");

arguments = gmp_arguments_new ();

Expand All @@ -3046,6 +3049,11 @@ get_tasks_gmp (gvm_connection_t *connection, credentials_t *credentials,
gmp_arguments_add (arguments, "ignore_pargination", ignore_pagination);
}

if (usage_type)
{
gmp_arguments_add (arguments, "usage_type", usage_type);
}

return get_many (connection, "tasks", credentials, params, arguments,
response_data);
}
Expand Down Expand Up @@ -7204,7 +7212,20 @@ char *
get_configs_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
return get_many (connection, "configs", credentials, params, NULL,
const char *usage_type;
gmp_arguments_t *arguments = NULL;

usage_type = params_value (params, "usage_type");
if (params_given (params, "usage_type"))
CHECK_VARIABLE_INVALID (usage_type, "Get Configs")

if (usage_type)
{
arguments = gmp_arguments_new ();
gmp_arguments_add (arguments, "usage_type", usage_type);
}

return get_many (connection, "configs", credentials, params, arguments,
response_data);
}

Expand Down