Skip to content

Conversation

@scotwells
Copy link
Contributor

This introduces a new command that can be used to list organizations the user has access to based on their Personal Access Token. This command will not work with service account based authentication.

Supports table, yaml, and json output.

$ go run . organizations list --hostname api.poc-1.env.datum.net --output table
DISPLAY NAME  RESOURCE ID
Organic Teal  izd57tciizfydaewnpa7xoe4ry

$ go run . organizations list --hostname api.poc-1.env.datum.net --output yaml
organizations:
  - name: organizations/izd57tciizfydaewnpa7xoe4ry
    organizationId: izd57tciizfydaewnpa7xoe4ry
    uid: 01JGA1QZ1W2VSFGNCV2CZD6RRT
    displayName: Organic Teal
    annotations:
      meta.datum.net/description: 'Personal Organization -  '
    createTime: "2024-12-29T20:29:25.948702Z"

$ go run . organizations list --hostname api.poc-1.env.datum.net --output json | jq
{
  "organizations": [
    {
      "name": "organizations/izd57tciizfydaewnpa7xoe4ry",
      "organizationId": "izd57tciizfydaewnpa7xoe4ry",
      "uid": "01JGA1QZ1W2VSFGNCV2CZD6RRT",
      "displayName": "Organic Teal",
      "annotations": {
        "meta.datum.net/description": "Personal Organization -  "
      },
      "createTime": "2024-12-29T20:29:25.948702Z"
    }
  ]
}

@scotwells scotwells requested a review from joshlreese December 29, 2024 22:30
Copy link
Contributor

@joshlreese joshlreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found an unused struct. Otherwise LGTM.

@scotwells scotwells requested a review from joshlreese December 29, 2024 22:57
@scotwells scotwells merged commit a942a02 into main Dec 29, 2024
1 check failed
@scotwells scotwells deleted the feature/org-list branch July 16, 2025 15:30
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.

3 participants