@@ -412,6 +412,224 @@ const (
412412 response: AssignedIds
413413 }
414414
415+ input BackupInput {
416+
417+ """
418+ Destination for the backup: e.g. Minio or S3 bucket.
419+ """
420+ destination: String!
421+
422+ """
423+ Access key credential for the destination.
424+ """
425+ accessKey: String
426+
427+ """
428+ Secret key credential for the destination.
429+ """
430+ secretKey: String
431+
432+ """
433+ AWS session token, if required.
434+ """
435+ sessionToken: String
436+
437+ """
438+ Set to true to allow backing up to S3 or Minio bucket that requires no credentials.
439+ """
440+ anonymous: Boolean
441+
442+ """
443+ Force a full backup instead of an incremental backup.
444+ """
445+ forceFull: Boolean
446+ }
447+
448+ type BackupPayload {
449+ response: Response
450+ taskId: String
451+ }
452+
453+ input RestoreInput {
454+
455+ """
456+ Destination for the backup: e.g. Minio or S3 bucket.
457+ """
458+ location: String!
459+
460+ """
461+ Backup ID of the backup series to restore. This ID is included in the manifest.json file.
462+ If missing, it defaults to the latest series.
463+ """
464+ backupId: String
465+
466+ """
467+ Number of the backup within the backup series to be restored. Backups with a greater value
468+ will be ignored. If the value is zero or missing, the entire series will be restored.
469+ """
470+ backupNum: Int
471+
472+ """
473+ All the backups with num >= incrementalFrom will be restored.
474+ """
475+ incrementalFrom: Int
476+
477+ """
478+ If isPartial is set to true then the cluster will be kept in draining mode after
479+ restore. This makes sure that the db is not corrupted by any mutations or tablet moves in
480+ between two restores.
481+ """
482+ isPartial: Boolean
483+
484+ """
485+ Path to the key file needed to decrypt the backup. This file should be accessible
486+ by all alphas in the group. The backup will be written using the encryption key
487+ with which the cluster was started, which might be different than this key.
488+ """
489+ encryptionKeyFile: String
490+
491+ """
492+ Vault server address where the key is stored. This server must be accessible
493+ by all alphas in the group. Default "http://localhost:8200".
494+ """
495+ vaultAddr: String
496+
497+ """
498+ Path to the Vault RoleID file.
499+ """
500+ vaultRoleIDFile: String
501+
502+ """
503+ Path to the Vault SecretID file.
504+ """
505+ vaultSecretIDFile: String
506+
507+ """
508+ Vault kv store path where the key lives. Default "secret/data/dgraph".
509+ """
510+ vaultPath: String
511+
512+ """
513+ Vault kv store field whose value is the key. Default "enc_key".
514+ """
515+ vaultField: String
516+
517+ """
518+ Vault kv store field's format. Must be "base64" or "raw". Default "base64".
519+ """
520+ vaultFormat: String
521+
522+ """
523+ Access key credential for the destination.
524+ """
525+ accessKey: String
526+
527+ """
528+ Secret key credential for the destination.
529+ """
530+ secretKey: String
531+
532+ """
533+ AWS session token, if required.
534+ """
535+ sessionToken: String
536+
537+ """
538+ Set to true to allow backing up to S3 or Minio bucket that requires no credentials.
539+ """
540+ anonymous: Boolean
541+ }
542+
543+ type RestorePayload {
544+ """
545+ A short string indicating whether the restore operation was successfully scheduled.
546+ """
547+ code: String
548+
549+ """
550+ Includes the error message if the operation failed.
551+ """
552+ message: String
553+ }
554+
555+ input ListBackupsInput {
556+ """
557+ Destination for the backup: e.g. Minio or S3 bucket.
558+ """
559+ location: String!
560+
561+ """
562+ Access key credential for the destination.
563+ """
564+ accessKey: String
565+
566+ """
567+ Secret key credential for the destination.
568+ """
569+ secretKey: String
570+
571+ """
572+ AWS session token, if required.
573+ """
574+ sessionToken: String
575+
576+ """
577+ Whether the destination doesn't require credentials (e.g. S3 public bucket).
578+ """
579+ anonymous: Boolean
580+
581+ }
582+
583+ type BackupGroup {
584+ """
585+ The ID of the cluster group.
586+ """
587+ groupId: UInt64
588+
589+ """
590+ List of predicates assigned to the group.
591+ """
592+ predicates: [String]
593+ }
594+
595+ type Manifest {
596+ """
597+ Unique ID for the backup series.
598+ """
599+ backupId: String
600+
601+ """
602+ Number of this backup within the backup series. The full backup always has a value of one.
603+ """
604+ backupNum: UInt64
605+
606+ """
607+ Whether this backup was encrypted.
608+ """
609+ encrypted: Boolean
610+
611+ """
612+ List of groups and the predicates they store in this backup.
613+ """
614+ groups: [BackupGroup]
615+
616+ """
617+ Path to the manifest file.
618+ """
619+ path: String
620+
621+ """
622+ The timestamp at which this backup was taken. The next incremental backup will
623+ start from this timestamp.
624+ """
625+ since: UInt64
626+
627+ """
628+ The type of backup, either full or incremental.
629+ """
630+ type: String
631+ }
632+
415633 ` + adminTypes + `
416634
417635 type Query {
@@ -421,6 +639,10 @@ const (
421639 state: MembershipState
422640 config: Config
423641 task(input: TaskInput!): TaskPayload
642+ """
643+ Get the information about the backups at a given location.
644+ """
645+ listBackups(input: ListBackupsInput!) : [Manifest]
424646 ` + adminQueries + `
425647 }
426648
@@ -474,6 +696,16 @@ const (
474696 """
475697 assign(input: AssignInput!): AssignPayload
476698
699+ """
700+ Start a binary backup.
701+ """
702+ backup(input: BackupInput!) : BackupPayload
703+
704+ """
705+ Start restoring a binary backup.
706+ """
707+ restore(input: RestoreInput!) : RestorePayload
708+
477709 ` + adminMutations + `
478710 }
479711 `
0 commit comments