-
Notifications
You must be signed in to change notification settings - Fork 256
/
ua_select.h
107 lines (93 loc) · 4.57 KB
/
ua_select.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2018-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef BAREOS_DIRD_UA_SELECT_H_
#define BAREOS_DIRD_UA_SELECT_H_
#include "dird/ua.h"
template <typename T> class alist;
struct PoolDbRecord;
struct MediaDbRecord;
struct StorageDbRecord;
struct ClientDbRecord;
struct JobDbRecord;
namespace directordaemon {
StorageResource* select_storage_resource(UaContext* ua,
bool autochanger_only = false);
JobResource* select_job_resource(UaContext* ua);
JobResource* select_enable_disable_job_resource(UaContext* ua, bool enable);
JobResource* select_restore_job_resource(UaContext* ua);
ClientResource* select_client_resource(UaContext* ua);
ClientResource* select_enable_disable_client_resource(UaContext* ua,
bool enable);
FilesetResource* select_fileset_resource(UaContext* ua);
ScheduleResource* select_enable_disable_schedule_resource(UaContext* ua,
bool enable);
bool SelectPoolForMediaDbr(UaContext* ua, PoolDbRecord* pr, MediaDbRecord* mr);
bool SelectMediaDbr(UaContext* ua, MediaDbRecord* mr);
bool SelectMediaDbrByName(UaContext* ua,
MediaDbRecord* mr,
const char* volumename);
bool SelectPoolDbr(UaContext* ua, PoolDbRecord* pr, const char* argk = "pool");
bool SelectStorageDbr(UaContext* ua,
StorageDbRecord* pr,
const char* argk = "storage");
bool SelectClientDbr(UaContext* ua, ClientDbRecord* cr);
void StartPrompt(UaContext* ua, const char* msg);
void AddPrompt(UaContext* ua, const char* prompt);
void AddPrompt(UaContext* ua, std::string&& prompt);
std::string FormatPrompts(const UaContext* ua,
int window_width,
int min_lines_threshold);
int DoPrompt(UaContext* ua,
const char* automsg,
const char* msg,
char* prompt,
int max_prompt);
CatalogResource* get_catalog_resource(UaContext* ua);
StorageResource* get_storage_resource(UaContext* ua,
bool use_default = false,
bool autochanger_only = false);
drive_number_t GetStorageDrive(UaContext* ua, StorageResource* store);
slot_number_t GetStorageSlot(UaContext* ua, StorageResource* store);
int GetMediaType(UaContext* ua, char* MediaType, int max_media);
bool GetPoolDbr(UaContext* ua, PoolDbRecord* pr, const char* argk = "pool");
bool GetStorageDbr(UaContext* ua,
StorageDbRecord* sr,
const char* argk = "storage");
bool GetClientDbr(UaContext* ua, ClientDbRecord* cr);
PoolResource* get_pool_resource(UaContext* ua);
JobResource* get_restore_job(UaContext* ua);
PoolResource* select_pool_resource(UaContext* ua);
alist<JobId_t*>* select_jobs(UaContext* ua, const char* reason);
ClientResource* get_client_resource(UaContext* ua);
int GetJobDbr(UaContext* ua, JobDbRecord* jr);
bool GetUserSlotList(UaContext* ua,
char* slot_list,
const char* argument,
int num_slots);
bool GetUserJobTypeListSelection(UaContext* ua,
std::vector<char>& passed_jobtypes,
bool ask_user);
bool GetUserJobStatusSelection(UaContext* ua, int* jobstatus);
bool GetUserJobLevelSelection(UaContext* ua, int* joblevel);
int FindArgKeyword(UaContext* ua, const char** list);
int FindArg(UaContext* ua, const char* keyword);
int FindArgWithValue(UaContext* ua, const char* keyword);
int DoKeywordPrompt(UaContext* ua, const char* msg, const char** list);
bool ConfirmRetention(UaContext* ua, utime_t* ret, const char* msg);
bool GetLevelFromName(JobControlRecord* jcr, const char* level_name);
} /* namespace directordaemon */
#endif // BAREOS_DIRD_UA_SELECT_H_