cta_admin.proto 18.8 KB
Newer Older
1
2
// @project        The CERN Tape Archive (CTA)
// @brief          CTA Admin Command API definition
3
// @copyright      Copyright 2019 CERN
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
// @license        This program is free software: you can redistribute it and/or modify
//                 it under the terms of the GNU General Public License as published by
//                 the Free Software Foundation, either version 3 of the License, or
//                 (at your option) any later version.
//
//                 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 General Public License for more details.
//
//                 You should have received a copy of the GNU General Public License
//                 along with this program.  If not, see <http://www.gnu.org/licenses/>.

syntax  = "proto3";
package cta.admin;

import "cta_common.proto";

//
// Command Options
//

message OptionBoolean {
  enum Key {
    DISABLED                           =  0;
    ENCRYPTED                          =  1;
    FORCE                              =  2;
    FULL                               =  3;
32
    READ_ONLY                          =  4;
33
    FROM_CASTOR                        =  5;
34
35

    // hasOption options
36
37
38
39
40
41
42
43
44
    ALL                                =  6;
    CHECK_CHECKSUM                     =  7;
    EXTENDED                           =  8;
    JUSTARCHIVE                        =  9;
    JUSTADDCOPIES                      = 10;
    JUSTMOVE                           = 11;
    JUSTRETRIEVE                       = 12;
    SHOW_LOG_ENTRIES                   = 13;
    SUMMARY                            = 14;
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  }

  Key key                              =  1;
  bool value                           =  2;
}

message OptionUInt64 {
  enum Key {
    ARCHIVE_FILE_ID                    =  0;
    ARCHIVE_PRIORITY                   =  1;
    RETRIEVE_PRIORITY                  =  2;
    CAPACITY                           =  3;
    COPY_NUMBER                        =  4;
    FIRST_FSEQ                         =  5;
    FILE_SIZE                          =  6;
60
61
62
63
64
65
66
67
68
    GID                                =  7;
    LAST_FSEQ                          =  8;
    MAX_DRIVES_ALLOWED                 =  9;
    MIN_ARCHIVE_REQUEST_AGE            = 10;
    MIN_RETRIEVE_REQUEST_AGE           = 11;
    NUMBER_OF_FILES                    = 12;
    OWNER_UID                          = 13;
    PARTIAL                            = 14;
    PARTIAL_TAPES_NUMBER               = 15;
69
70
    REFRESH_INTERVAL                   = 16;
    TARGETED_FREE_SPACE                = 17;
71
72
    READ_MOUNT_COUNT                   = 18;
    WRITE_MOUNT_COUNT                  = 19;
73
    SLEEP_TIME                         = 20;
74
75
76
77
78
79
80
81
82
83
84
  }

  Key key                              =  1;
  uint64 value                         =  2;
}

message OptionString {
  enum Key {
    COMMENT                            =  0;
    DISKID                             =  1;
    DRIVE                              =  2;
85
    ENCRYPTION_KEY_NAME                =  3;
86
    FILENAME                           =  4;
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    HOSTNAME                           =  5;
    INPUT                              =  6;
    INSTANCE                           =  7;
    LOGICAL_LIBRARY                    =  8;
    MOUNT_POLICY                       =  9;
    OUTPUT                             = 10;
    PATH                               = 11;
    STORAGE_CLASS                      = 12;
    TAPE_POOL                          = 13;
    USERNAME                           = 14;
    VID                                = 15;
    VO                                 = 16;
    BUFFERURL                          = 17;
    MEDIA_TYPE                         = 18;
    VENDOR                             = 19;
102
    SUPPLY                             = 20;
103
104
105
    DISK_SYSTEM                        = 21;
    FILE_REGEXP                        = 22;
    FREE_SPACE_QUERY_URL               = 23;
106
107
108
109
110
111
  }

  Key key                              =  1;
  string value                         =  2;
}

112
113
114
115
116
117
118
119
120
message OptionStrList {
  enum Key {
    VID                                =  0;
  }

  Key key                              =  1;
  repeated string item                 =  2;
}

121
122
123
124
125
126
127
128
//
// CTA Admin Command API
//

message AdminCmd {
  enum Cmd {
    CMD_NONE                           =  0;
    CMD_ADMIN                          =  1;
129
130
131
    CMD_ARCHIVEFILE                    =  2;
    CMD_ARCHIVEROUTE                   =  3;
    CMD_DRIVE                          =  4;
132
133
134
135
136
137
138
139
140
    CMD_FAILEDREQUEST                  =  5;
    CMD_GROUPMOUNTRULE                 =  6;
    CMD_LISTPENDINGARCHIVES            =  7;
    CMD_LISTPENDINGRETRIEVES           =  8;
    CMD_LOGICALLIBRARY                 =  9;
    CMD_MOUNTPOLICY                    = 10;
    CMD_REPACK                         = 11;
    CMD_REQUESTERMOUNTRULE             = 12;
    CMD_SHOWQUEUES                     = 13;
Michael Davis's avatar
Michael Davis committed
141
142
143
    CMD_STORAGECLASS                   = 14;
    CMD_TAPE                           = 15;
    CMD_TAPEPOOL                       = 16;
144
    CMD_DISKSYSTEM                     = 17;
145
146
147
148
149
  }
  enum SubCmd {
    SUBCMD_NONE                        =  0;
    SUBCMD_ADD                         =  1;
    SUBCMD_CH                          =  2;
Michael Davis's avatar
Michael Davis committed
150
151
152
153
154
155
156
157
158
    SUBCMD_ERR                         =  3;
    SUBCMD_LABEL                       =  4;
    SUBCMD_LS                          =  5;
    SUBCMD_RECLAIM                     =  6;
    SUBCMD_RM                          =  7;
    SUBCMD_UP                          =  8;
    SUBCMD_DOWN                        =  9;
    SUBCMD_RETRY                       = 10;
    SUBCMD_SHOW                        = 11;
159
160
  }

161
162
163
164
165
166
  Cmd cmd                                = 1;    //< The primary command
  SubCmd subcmd                          = 2;    //< The secondary command
  repeated OptionBoolean option_bool     = 3;    //< List of boolean options
  repeated OptionUInt64  option_uint64   = 4;    //< List of integer options
  repeated OptionString  option_str      = 5;    //< List of string options
  repeated OptionStrList option_str_list = 6;    //< List of string list options
167
168
}

169
170
171
172
173
174
//
// Stream response header type
//

enum HeaderType {
  NONE                         =  0;    //< No header (default)
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
  ADMIN_LS                     =  1;    //< cta-admin admin ls
  ARCHIVEFILE_LS               =  2;    //< cta-admin archivefile ls
  ARCHIVEFILE_LS_SUMMARY       =  3;    //< cta-admin archivefile ls -S
  ARCHIVEROUTE_LS              =  4;    //< cta-admin archiveroute ls
  DRIVE_LS                     =  5;    //< cta-admin drive ls
  FAILEDREQUEST_LS             =  6;    //< cta-admin failedrequest ls
  FAILEDREQUEST_LS_SUMMARY     =  7;    //< cta-admin failedrequest ls -S
  GROUPMOUNTRULE_LS            =  8;    //< cta-admin groupmountrule ls
  LISTPENDINGARCHIVES          =  9;    //< cta-admin listpendingarchives -x
  LISTPENDINGARCHIVES_SUMMARY  = 10;    //< cta-admin listpendingarchives
  LISTPENDINGRETRIEVES         = 11;    //< cta-admin listpendingretrieves -x
  LISTPENDINGRETRIEVES_SUMMARY = 12;    //< cta-admin listpendingretrieves
  LOGICALLIBRARY_LS            = 13;    //< cta-admin logicallibrary ls
  MOUNTPOLICY_LS               = 14;    //< cta-admin mountpolicy ls
  REPACK_LS                    = 15;    //< cta-admin repack ls
  REQUESTERMOUNTRULE_LS        = 16;    //< cta-admin requestermountrule ls
191
  SHOWQUEUES                   = 17;    //< cta-admin showqueues ls
192
193
194
  STORAGECLASS_LS              = 18;    //< cta-admin storageclass ls
  TAPE_LS                      = 19;    //< cta-admin ta ls
  TAPEPOOL_LS                  = 20;    //< cta-admin tapepool ls
195
  DISKSYSTEM_LS                = 21;    //< cta-admin disksystem ls
196
197
}

198
//
199
// Stream response types
200
201
//

202
203
204
205
206
207
208
209
210
211
enum MountType {
  UNKNOWN_MOUNT_TYPE                        = 0;
  NO_MOUNT                                  = 1;
  ARCHIVE_FOR_USER                          = 2;
  ARCHIVE_FOR_REPACK                        = 3;
  ARCHIVE_ALL_TYPES                         = 4;
  RETRIEVE                                  = 5;
  LABEL                                     = 6;
}

212
enum RequestType {
213
214
215
216
217
218
219
220
221
222
  TOTAL                                     = 0;    //< Used for summary totals
  ARCHIVE_REQUEST                           = 1;    //< Archive request
  RETRIEVE_REQUEST                          = 2;    //< Retrieve request
}

message AdminLsItem {
  string user                               = 1;
  cta.common.EntryLog creation_log          = 2;
  cta.common.EntryLog last_modification_log = 3;
  string comment                            = 4;
223
224
}

225
message ArchiveFileLsItem {
226
227
228
  cta.common.ArchiveFile af                 = 1;
  cta.common.TapeFile tf                    = 2;
  uint64 copy_nb                            = 3;
229
}
230

231
message ArchiveFileLsSummary {
232
233
234
235
236
237
238
239
240
241
242
243
244
245
  uint64 total_files                        = 1;
  uint64 total_size                         = 2;
}

message ArchiveRouteLsItem {
  string instance                           = 1;
  string storage_class                      = 2;
  uint32 copy_number                        = 3;
  string tapepool                           = 4;
  cta.common.EntryLog creation_log          = 5;
  cta.common.EntryLog last_modification_log = 6;
  string comment                            = 7;
}

246
247
248
249
250
251
252
message DriveConfigItem {
  string category                  = 1;
  string key                       = 2;
  string value                     = 3;
  string source                    = 4;
}

253
message DriveLsItem {
254
  enum DriveStatus {
255
    UNKNOWN_DRIVE_STATUS                    =  0;
256
    DOWN                                    =  1;
257
258
259
260
261
262
263
264
265
266
267
268
    UP                                      =  2;
    PROBING                                 =  3;
    STARTING                                =  4;
    MOUNTING                                =  5;
    TRANSFERRING                            =  6;
    UNLOADING                               =  7;
    UNMOUNTING                              =  8;
    DRAINING_TO_DISK                        =  9;
    CLEANING_UP                             = 10;
    SHUTDOWN                                = 11;
  }

269
270
271
  string logical_library                    =  1;
  string drive_name                         =  2;
  string host                               =  3;
272
273
274
  DriveStatus desired_drive_state           =  4;
  MountType mount_type                      =  5;
  DriveStatus drive_status                  =  6;
275
276
277
278
  uint64 drive_status_since                 =  7;
  string vid                                =  8;
  string tapepool                           =  9;
  uint64 files_transferred_in_session       = 10;
279
280
  uint64 bytes_transferred_in_session       = 11;
  uint64 latest_bandwidth                   = 12;
281
282
  uint64 session_id                         = 13;
  uint64 time_since_last_update             = 14;
283
284
  uint64 current_priority                   = 15;
  string current_activity                   = 16;
285
  string cta_version                        = 17;
286
287
288
  string dev_file_name                      = 18;
  string raw_library_slot                   = 19;
  repeated DriveConfigItem drive_config     = 20;
289
290
}

291
message FailedRequestLsItem {
292
293
294
295
296
297
298
299
  RequestType request_type                  = 1;
  cta.common.RequesterId requester          = 2;
  cta.common.ArchiveFile af                 = 3;
  cta.common.TapeFile tf                    = 4;
  string tapepool                           = 5;    //< For archive requests only
  uint64 copy_nb                            = 6;
  uint32 totalretries                       = 7;
  repeated string failurelogs               = 8;
300
301
302
}

message FailedRequestLsSummary {
303
304
305
306
307
308
309
  RequestType request_type                  = 1;
  uint64 total_files                        = 2;
  uint64 total_size                         = 3;
}

message GroupMountRuleLsItem {
  string disk_instance                      = 1;
310
  string group_mount_rule                   = 2;
311
312
313
  string mount_policy                       = 3;
  cta.common.EntryLog creation_log          = 4;
  cta.common.EntryLog last_modification_log = 5;
314
  string comment                            = 6;
315
316
}

317
message ListPendingArchivesItem {
318
319
320
321
  cta.common.ArchiveFile af                 = 1;
  cta.common.TapeFile tf                    = 2;
  uint64 copy_nb                            = 3;
  string tapepool                           = 4;
322
}
323

324
message ListPendingArchivesSummary {
325
326
327
  string tapepool                           = 1;
  uint64 total_files                        = 2;
  uint64 total_size                         = 3;
328
329
330
}

message ListPendingRetrievesItem {
331
332
333
  cta.common.ArchiveFile af                 = 1;
  cta.common.TapeFile tf                    = 2;
  uint64 copy_nb                            = 3;
334
}
335

336
message ListPendingRetrievesSummary {
337
  string vid                                = 1;
338
339
  uint64 total_files                        = 2;
  uint64 total_size                         = 3;
340
341
}

342
343
344
345
346
347
message LogicalLibraryLsItem {
  string name                               = 1;
  bool is_disabled                          = 2;
  cta.common.EntryLog creation_log          = 3;
  cta.common.EntryLog last_modification_log = 4;
  string comment                            = 5;
Cedric CAFFY's avatar
Cedric CAFFY committed
348
349
}

350
351
352
353
354
355
356
357
358
359
message MountPolicyLsItem {
  string name                               = 1;
  uint64 archive_priority                   = 2;
  uint64 archive_min_request_age            = 3;
  uint64 retrieve_priority                  = 4;
  uint64 retrieve_min_request_age           = 5;
  uint64 max_drives_allowed                 = 6;
  cta.common.EntryLog creation_log          = 7;
  cta.common.EntryLog last_modification_log = 8;
  string comment                            = 9;
Cedric CAFFY's avatar
Cedric CAFFY committed
360
361
}

362
message RepackDestinationInfos{
363
364
365
  string vid                                = 1;
  uint64 files                              = 2;
  uint64 bytes                              = 3;
366
367
}

368
message RepackLsItem {
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
  string vid                                        =  1;
  string repack_buffer_url                          =  2;
  uint64 user_provided_files                        =  3;
  uint64 total_files_to_retrieve                    =  4;
  uint64 total_bytes_to_retrieve                    =  5;
  uint64 total_files_to_archive                     =  6;
  uint64 total_bytes_to_archive                     =  7;
  uint64 retrieved_files                            =  8;
  uint64 archived_files                             =  9;
  uint64 failed_to_retrieve_files                   = 10;
  uint64 failed_to_retrieve_bytes                   = 11;
  uint64 failed_to_archive_files                    = 12;
  uint64 failed_to_archive_bytes                    = 13;
  uint64 last_expanded_fseq                         = 14;
  string status                                     = 15;
  repeated RepackDestinationInfos destination_infos = 16;
Cedric CAFFY's avatar
Cedric CAFFY committed
385
386
}

387
388
message RequesterMountRuleLsItem {
  string disk_instance                      = 1;
389
  string requester_mount_rule               = 2;
390
391
  string mount_policy                       = 3;
  cta.common.EntryLog creation_log          = 4;
Cedric CAFFY's avatar
Cedric CAFFY committed
392
  cta.common.EntryLog last_modification_log = 5;
393
  string comment                            = 6;
Cedric CAFFY's avatar
Cedric CAFFY committed
394
395
}

396
message ShowQueuesItem {
397
  MountType mount_type                      =  1;
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
  string tapepool                           =  2;
  string logical_library                    =  3;
  string vid                                =  4;
  uint64 queued_files                       =  5;
  uint64 queued_bytes                       =  6;
  uint64 oldest_age                         =  7;
  uint64 priority                           =  8;
  uint64 min_age                            =  9;
  uint64 max_drives                         = 10;
  uint64 cur_mounts                         = 11;
  uint64 cur_files                          = 12;
  uint64 cur_bytes                          = 13;
  uint64 bytes_per_second                   = 14;
  uint64 next_mounts                        = 15;
  uint64 tapes_capacity                     = 16;
  uint64 tapes_files                        = 17;
  uint64 tapes_bytes                        = 18;
  uint64 full_tapes                         = 19;
  uint64 empty_tapes                        = 20;
  uint64 disabled_tapes                     = 21;
418
419
  uint64 rdonly_tapes                       = 22;
  uint64 writable_tapes                     = 23;
420
421
422
  bool sleeping_for_space                   = 24;
  uint64 sleep_start_time                   = 25;
  string disk_system_slept_for              = 26;
Cedric CAFFY's avatar
Cedric CAFFY committed
423
424
}

425
426
427
428
429
430
431
message StorageClassLsItem {
  string disk_instance                      = 1;
  string name                               = 2;
  uint64 nb_copies                          = 3;
  cta.common.EntryLog creation_log          = 4;
  cta.common.EntryLog last_modification_log = 5;
  string comment                            = 6;
Cedric CAFFY's avatar
Cedric CAFFY committed
432
433
}

434
435
436
437
438
439
440
message TapeLsItem {
  string vid                                =  1;
  string media_type                         =  2;
  string vendor                             =  3;
  string logical_library                    =  4;
  string tapepool                           =  5;
  string vo                                 =  6;
441
  string encryption_key_name                =  7;
442
443
444
445
446
  uint64 capacity                           =  8;
  uint64 occupancy                          =  9;
  uint64 last_fseq                          = 10;
  bool full                                 = 11;
  bool disabled                             = 12;
447
  bool rdonly                               = 13;
448
449
450
451
452
453
454
455
456
  bool from_castor                          = 14;
  uint64 read_mount_count                   = 15;
  uint64 write_mount_count                  = 16;
  cta.common.TapeLog label_log              = 17;
  cta.common.TapeLog last_written_log       = 18;
  cta.common.TapeLog last_read_log          = 19;
  cta.common.EntryLog creation_log          = 20;
  cta.common.EntryLog last_modification_log = 21;
  string comment                            = 22;
Cedric CAFFY's avatar
Cedric CAFFY committed
457
458
}

Michael Davis's avatar
Michael Davis committed
459
460
461
462
463
464
message TapeFileLsItem {
  cta.common.ArchiveFile af                 = 1;
  cta.common.TapeFile tf                    = 2;
  uint64 copy_nb                            = 3;
}

465
466
467
468
469
470
471
472
473
474
475
476
477
message TapePoolLsItem {
  string name                               =  1;
  string vo                                 =  2;
  uint64 num_tapes                          =  3;
  uint64 num_partial_tapes                  =  4;
  uint64 num_physical_files                 =  5;
  uint64 capacity_bytes                     =  6;
  uint64 data_bytes                         =  7;
  bool   encrypt                            =  8;
  string supply                             =  9;
  cta.common.EntryLog created               = 10;
  cta.common.EntryLog modified              = 11;
  string comment                            = 12;
Cedric CAFFY's avatar
Cedric CAFFY committed
478
479
}

480
481
482
483
484
485
message DiskSystemLsItem {
  string name                               =  1;
  string file_regexp                        =  2;
  string free_space_query_url               =  3;
  uint64 refresh_interval                   =  4;
  uint64 targeted_free_space                =  5;
486
  uint64 sleep_time                         =  9;
487
488
489
490
  cta.common.EntryLog creation_log          =  6;
  cta.common.EntryLog last_modification_log =  7;
  string comment                            =  8;
}