Skip to content
DocsOpenAPI spec

    List Object Storage Keys

    client.Storage.Keys.List(ctx, query) (*Cursor[ObjectStorageKey], error)
    GET/v1/storage/keys

    List all Object Storage Keys. Secret access keys are not included.

    ParametersExpand Collapse
    query KeyListParams
    ProjectID param.Field[string]

    Project ID of resources to request

    Cursor param.Field[string]Optional

    Pagination cursor returned by a previous request. Only valid for the same filters and sort order.

    Limit param.Field[int64]Optional

    Maximum number of items to return

    maximum100
    minimum10
    Name param.Field[string]Optional

    Filter by a case-insensitive substring of the Object Storage Key name

    Region param.Field[string]Optional

    Filter by region

    Sort param.Field[string]Optional

    Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at, name

    ReturnsExpand Collapse
    type ObjectStorageKey struct{…}

    Object Storage Key details. The secret access key is only returned when the key is created.

    ID string

    Unique identifier for the Object Storage Key.

    AccessKey string

    S3 access key ID.

    CreatedAt Time

    When the Object Storage Key was created.

    formatdate-time
    Name string

    Name of the Object Storage Key.

    ProjectID string

    Project ID the Object Storage Key belongs to.

    Region RegionName

    Region the resource is in.

    One of the following:
    const RegionNameUsSva2 RegionName = "us-sva-2"
    const RegionNameUsWdc1 RegionName = "us-wdc-1"

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    const ResourceStatusSuspended ResourceStatus = "suspended"
    UpdatedAt Time

    When the Object Storage Key was updated.

    formatdate-time

    List Object Storage Keys

    package main
    
    import (
      "context"
      "fmt"
    
      "github.com/nirvana-labs/nirvana-go"
      "github.com/nirvana-labs/nirvana-go/option"
      "github.com/nirvana-labs/nirvana-go/storage"
    )
    
    func main() {
      client := nirvana.NewClient(
        option.WithAPIKey("My API Key"),
      )
      page, err := client.Storage.Keys.List(context.TODO(), storage.KeyListParams{
        ProjectID: "project_id",
      })
      if err != nil {
        panic(err.Error())
      }
      fmt.Printf("%+v\n", page)
    }
    
    {
      "items": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "access_key": "0555B35654AD1656D804",
          "created_at": "2025-01-01T00:00:00Z",
          "name": "ci-uploads",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "region": "us-sva-2",
          "status": "ready",
          "updated_at": "2025-01-01T00:00:00Z"
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }
    Returns Examples
    {
      "items": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "access_key": "0555B35654AD1656D804",
          "created_at": "2025-01-01T00:00:00Z",
          "name": "ci-uploads",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "region": "us-sva-2",
          "status": "ready",
          "updated_at": "2025-01-01T00:00:00Z"
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }