Method: projects.locations.repositories.workspaces.queryDirectoryContents

Returns the contents of a given Workspace directory.

HTTP request

GET https://dataform.googleapis.com/v1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
workspace

string

Required. The workspace's name.

Authorization requires the following IAM permission on the specified resource workspace:

  • dataform.workspaces.queryDirectoryContents

Query parameters

Parameters
path

string

Optional. The directory's full path including directory name, relative to the workspace root. If left unset, the workspace root is used.

pageSize

integer

Optional. Maximum number of paths to return. The server may return fewer items than requested. If unspecified, the server will pick an appropriate default.

pageToken

string

Optional. Page token received from a previous workspaces.queryDirectoryContents call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to workspaces.queryDirectoryContents, with the exception of pageSize, must match the call that provided the page token.

view

enum (DirectoryContentsView)

Optional. Specifies the metadata to return for each directory entry. If unspecified, the default is DIRECTORY_CONTENTS_VIEW_BASIC. Currently the DIRECTORY_CONTENTS_VIEW_METADATA view is not supported by CMEK-protected workspaces.

Request body

The request body must be empty.

Response body

workspaces.queryDirectoryContents response message.

If successful, the response body contains data with the following structure:

JSON representation
{
  "directoryEntries": [
    {
      object (DirectoryEntry)
    }
  ],
  "nextPageToken": string
}
Fields
directoryEntries[]

object (DirectoryEntry)

List of entries in the directory.

nextPageToken

string

A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no subsequent pages.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/bigquery

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the workspace resource:

  • dataform.workspaces.queryDirectoryContents

For more information, see the IAM documentation.

DirectoryContentsView

Represents the level of detail to return for directory contents.

Enums
DIRECTORY_CONTENTS_VIEW_UNSPECIFIED The default unset value. Defaults to DIRECTORY_CONTENTS_VIEW_BASIC.
DIRECTORY_CONTENTS_VIEW_BASIC Includes only the file or directory name. This is the default behavior.
DIRECTORY_CONTENTS_VIEW_METADATA Includes all metadata for each file or directory. Currently not supported by CMEK-protected workspaces.