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

feat: Adding support to handle variable collection #1506

Merged
merged 7 commits into from
Nov 9, 2024
Merged

Conversation

alfespa17
Copy link
Member

This PR add support to create and manage "Collections" this will be the Terrakube equivalent for variables sets

There is a new teams permission called "manageCollection" that is require to create the "collection".

Create Collection

POST /api/v1/organization/${ORGANIZATION_ID}/collection/

{
    "data": {
        "type": "collection",
        "attributes": {
            "description": "Sample Description",
            "name": "Collection1",
            "priority": 10,
        }
}

Higher the number higher will be the priority

Create Collection Item

POST /api/v1/organization/${ORGANIZATION_ID}/collection/"${COLLECTION_ID}/item/

{
    "data": {
        "type": "item",
        "attributes": {
            "category": "ENV",
            "description": "random_description",
            "hcl": false,
            "key": "random_key",
            "sensitive": true
        }
}

The type could be Environment Variables or Terraform/Tofu Variables

Create Collection Reference to Workspace

POST /api/v1/organization/${ORGANIZATION_ID}/collection/"${COLLECTION_ID}/reference/

{
    "data": {
        "type": "reference",
        "attributes": {
            "description": "my random description"
        },
        "relationships": {
            "workspace": {
                "data": {
                    "type": "workspace",
                    "id": "5ed411ca-7ab8-4d2f-b591-02d0d5788afc"
                }
            }
        }
    }
}

Fix #1146

Copy link

sonarcloud bot commented Nov 9, 2024

@alfespa17 alfespa17 merged commit 71de5f6 into main Nov 9, 2024
5 checks passed
@alfespa17 alfespa17 deleted the feat/tags-group branch November 9, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variable sets
1 participant