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

[FLI-847] Proposal: Copy Namespace API #2780

Open
1 task done
markphelps opened this issue Feb 16, 2024 · 0 comments
Open
1 task done

[FLI-847] Proposal: Copy Namespace API #2780

markphelps opened this issue Feb 16, 2024 · 0 comments
Labels
enhancement Created by Linear-GitHub Sync proposal Just putting it out there xl As big as it gets

Comments

@markphelps
Copy link
Collaborator

markphelps commented Feb 16, 2024

Problem

If namespaces are used as environments its challenging to copy data from one namespace to another without relying on export/import.

Ideal Solution

It would be nice if we provided a 'Copy Namespace API' that allows the user to duplicate all data from one namespace to a new or potentially existing one. More on the latter below.

Potential Structure

URL: POST /api/v1/namespaces/{sourceNamespace}/copy
Body:

{
  "target": {
    "key": "string",
   },
  "conflict_strategy": "fail"
}

Field Descriptions

  • target/target.key contains info about the destination namespace either to be created or existing. its an object to allow for future iteration (ie: maybe we add a name field allowing the new namespace to be created with key and name, by default name will match key)
  • conflict_strategy: options fail | overwrite , specifies what to do on conflict (only for existing namespaces) that is conflicts that occur from object key/id collision. Either we fail the operation or overwrite the target namespace. Default would be fail.

Etc

  • After this API existed we could then easily add the ability to copy namespaces in the UI
  • This would only work for relational backends as declarative backends are read-only

Search

  • I searched for other open and closed issues before opening this

Additional Context

Example: https://api.permit.io/v2/redoc#tag/Environments/operation/copy_environment

FLI-847

@markphelps markphelps added proposal Just putting it out there enhancement Created by Linear-GitHub Sync labels Feb 16, 2024
@markphelps markphelps changed the title Proposal: Copy Namespace API [FLI-847] Proposal: Copy Namespace API Feb 16, 2024
@markphelps markphelps added the xl As big as it gets label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Created by Linear-GitHub Sync proposal Just putting it out there xl As big as it gets
Projects
Status: No status
Development

No branches or pull requests

1 participant