Skip to content

Commit

Permalink
feat: restore job entrypoint and capability (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Francesco Canovai <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Francesco Canovai <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2024
1 parent ac20c72 commit c704f46
Show file tree
Hide file tree
Showing 7 changed files with 861 additions and 32 deletions.
9 changes: 9 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ PostgresCapability
Pre
ProbeRequest
ProbeResponse
PGDATA
RPC
RPC
RPCs
Expand All @@ -62,6 +63,12 @@ ReconcilerHooksCapabilitiesResult
ReconcilerHooksCapability
ReconcilerHooksRequest
ReconcilerHooksResult
RestoreJobHooks
RestoreJobHooksCapabilitiesRequest
RestoreJobHooksCapabilitiesResult
RestoreJobHooksCapability
RestoreRequest
RestoreResponse
ScheduledBackup
SetFirstRequired
SetFirstRequiredRequest
Expand Down Expand Up @@ -92,11 +99,13 @@ bool
boolean
cncf
cnpg
config
configs
csi
customizable
customizations
edb
envs
fixnum
gRPC
html
Expand Down
123 changes: 123 additions & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@

- [ReconcilerHooks](#cnpgi-reconciler-v1-ReconcilerHooks)

- [restore_job.proto](#restore_job-proto)
- [RestoreJobHooksCapabilitiesRequest](#cnpgi-wal-v1-RestoreJobHooksCapabilitiesRequest)
- [RestoreJobHooksCapabilitiesResult](#cnpgi-wal-v1-RestoreJobHooksCapabilitiesResult)
- [RestoreJobHooksCapability](#cnpgi-wal-v1-RestoreJobHooksCapability)
- [RestoreRequest](#cnpgi-wal-v1-RestoreRequest)
- [RestoreResponse](#cnpgi-wal-v1-RestoreResponse)

- [RestoreJobHooksCapability.Kind](#cnpgi-wal-v1-RestoreJobHooksCapability-Kind)

- [RestoreJobHooks](#cnpgi-wal-v1-RestoreJobHooks)

- [wal.proto](#wal-proto)
- [SetFirstRequiredRequest](#cnpgi-wal-v1-SetFirstRequiredRequest)
- [SetFirstRequiredResult](#cnpgi-wal-v1-SetFirstRequiredResult)
Expand Down Expand Up @@ -439,6 +450,7 @@ Intentionally empty.
| TYPE_BACKUP_SERVICE | 3 | TYPE_BACKUP_SERVICE indicates that the Plugin provides RPCs for the Backup service. The presence of this capability determines whether the CO will attempt to invoke the REQUIRED Backup Service RPCs, as well as specific RPCs as indicated by GetCapabilities. |
| TYPE_LIFECYCLE_SERVICE | 4 | TYPE_LIFECYCLE_SERVICE indicates that the Plugin provides RPCs for the Lifecycle service. |
| TYPE_RECONCILER_HOOKS | 5 | TYPE_RECONCILER_HOOKS indicates that the Plugin provides RPCs to enhance the behavior of the reconcilers |
| TYPE_RESTORE_JOB | 6 | TYPE_RESTORE_JOB_HOOKS indicates that the Plugin provides RPCs to enhance the behavior of the restore jobs |



Expand Down Expand Up @@ -1143,6 +1155,117 @@ through the kube-api server.



<a name="restore_job-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## restore_job.proto



<a name="cnpgi-wal-v1-RestoreJobHooksCapabilitiesRequest"></a>

### RestoreJobHooksCapabilitiesRequest







<a name="cnpgi-wal-v1-RestoreJobHooksCapabilitiesResult"></a>

### RestoreJobHooksCapabilitiesResult



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| capabilities | [RestoreJobHooksCapability](#cnpgi-wal-v1-RestoreJobHooksCapability) | repeated | This field is REQUIRED and contains the describe capability |






<a name="cnpgi-wal-v1-RestoreJobHooksCapability"></a>

### RestoreJobHooksCapability



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| kind | [RestoreJobHooksCapability.Kind](#cnpgi-wal-v1-RestoreJobHooksCapability-Kind) | | |






<a name="cnpgi-wal-v1-RestoreRequest"></a>

### RestoreRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| cluster_definition | [bytes](#bytes) | | This field is REQUIRED. Value of this field is the JSON serialization of the Cluster. |






<a name="cnpgi-wal-v1-RestoreResponse"></a>

### RestoreResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| restore_config | [string](#string) | | This field is REQUIRED. Value of this field is the string representation of PostgreSQL configuration parameters to use for the restore. |
| envs | [string](#string) | repeated | This field if REQUIRED. Environment variables to be set in the restore job, expressed as NAME=VALUE. |








<a name="cnpgi-wal-v1-RestoreJobHooksCapability-Kind"></a>

### RestoreJobHooksCapability.Kind


| Name | Number | Description |
| ---- | ------ | ----------- |
| KIND_UNSPECIFIED | 0 | |
| KIND_RESTORE | 1 | KIND_RESTORE means that the plugin is able to handle Restore requests |







<a name="cnpgi-wal-v1-RestoreJobHooks"></a>

### RestoreJobHooks
RestoreJobHooks offers a way for the plugins to enhance the cluster
recovery process

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetCapabilities | [RestoreJobHooksCapabilitiesRequest](#cnpgi-wal-v1-RestoreJobHooksCapabilitiesRequest) | [RestoreJobHooksCapabilitiesResult](#cnpgi-wal-v1-RestoreJobHooksCapabilitiesResult) | GetCapabilities gets the capabilities of the Backup service |
| Restore | [RestoreRequest](#cnpgi-wal-v1-RestoreRequest) | [RestoreResponse](#cnpgi-wal-v1-RestoreResponse) | Restore is called to restore a PGDATA |





<a name="wal-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
69 changes: 38 additions & 31 deletions pkg/identity/identity.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c704f46

Please sign in to comment.