tags

package
v0.202.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

These APIs allow you to manage Tag Policies, Workspace Entity Tag Assignments, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTagAssignmentRequest added in v0.93.0

type CreateTagAssignmentRequest struct {
	TagAssignment TagAssignment `json:"tag_assignment"`
}

func (*CreateTagAssignmentRequest) UnmarshalJSON added in v0.174.0

func (s *CreateTagAssignmentRequest) UnmarshalJSON(b []byte) error

type CreateTagPolicyRequest

type CreateTagPolicyRequest struct {
	TagPolicy TagPolicy `json:"tag_policy"`
}

func (*CreateTagPolicyRequest) UnmarshalJSON added in v0.174.0

func (s *CreateTagPolicyRequest) UnmarshalJSON(b []byte) error

type DeleteTagAssignmentRequest added in v0.93.0

type DeleteTagAssignmentRequest struct {
	// The identifier of the entity to which the tag is assigned. For apps, the
	// entity_id is the app name
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are apps,
	// dashboards, geniespaces, notebooks
	EntityType string `json:"-" url:"-"`
	// The key of the tag. The characters , . : / - = and leading/trailing
	// spaces are not allowed
	TagKey string `json:"-" url:"-"`
}

func (*DeleteTagAssignmentRequest) UnmarshalJSON added in v0.174.0

func (s *DeleteTagAssignmentRequest) UnmarshalJSON(b []byte) error

type DeleteTagPolicyRequest

type DeleteTagPolicyRequest struct {
	// The key of the governed tag whose policy to delete.
	TagKey string `json:"-" url:"-"`
}

func (*DeleteTagPolicyRequest) UnmarshalJSON added in v0.174.0

func (s *DeleteTagPolicyRequest) UnmarshalJSON(b []byte) error

type GetTagAssignmentRequest added in v0.93.0

type GetTagAssignmentRequest struct {
	// The identifier of the entity to which the tag is assigned. For apps, the
	// entity_id is the app name
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are apps,
	// dashboards, geniespaces, notebooks
	EntityType string `json:"-" url:"-"`
	// The key of the tag. The characters , . : / - = and leading/trailing
	// spaces are not allowed
	TagKey string `json:"-" url:"-"`
}

func (*GetTagAssignmentRequest) UnmarshalJSON added in v0.174.0

func (s *GetTagAssignmentRequest) UnmarshalJSON(b []byte) error

type GetTagPolicyRequest

type GetTagPolicyRequest struct {
	// The key of the governed tag whose policy to get.
	TagKey string `json:"-" url:"-"`
}

func (*GetTagPolicyRequest) UnmarshalJSON added in v0.174.0

func (s *GetTagPolicyRequest) UnmarshalJSON(b []byte) error

type ListTagAssignmentsRequest added in v0.93.0

type ListTagAssignmentsRequest struct {
	// The identifier of the entity to which the tag is assigned. For apps, the
	// entity_id is the app name
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are apps,
	// dashboards, geniespaces, notebooks
	EntityType string `json:"-" url:"-"`
	// Optional. Maximum number of tag assignments to return in a single page
	PageSize int `json:"-" url:"page_size,omitempty"`
	// Pagination token to go to the next page of tag assignments. Requests
	// first page if absent.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListTagAssignmentsRequest) MarshalJSON added in v0.93.0

func (s ListTagAssignmentsRequest) MarshalJSON() ([]byte, error)

func (*ListTagAssignmentsRequest) UnmarshalJSON added in v0.93.0

func (s *ListTagAssignmentsRequest) UnmarshalJSON(b []byte) error

type ListTagAssignmentsResponse added in v0.93.0

type ListTagAssignmentsResponse struct {
	// Pagination token to request the next page of tag assignments
	NextPageToken string `json:"next_page_token,omitempty"`

	TagAssignments []TagAssignment `json:"tag_assignments,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListTagAssignmentsResponse) MarshalJSON added in v0.93.0

func (s ListTagAssignmentsResponse) MarshalJSON() ([]byte, error)

func (*ListTagAssignmentsResponse) UnmarshalJSON added in v0.93.0

func (s *ListTagAssignmentsResponse) UnmarshalJSON(b []byte) error

type ListTagPoliciesRequest

type ListTagPoliciesRequest struct {
	// The maximum number of results to return in this request. Fewer results
	// may be returned than requested. If unspecified or set to 0, this defaults
	// to 1000. The maximum value is 1000; values above 1000 will be coerced
	// down to 1000.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// An optional page token received from a previous list tag policies call.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListTagPoliciesRequest) MarshalJSON

func (s ListTagPoliciesRequest) MarshalJSON() ([]byte, error)

func (*ListTagPoliciesRequest) UnmarshalJSON

func (s *ListTagPoliciesRequest) UnmarshalJSON(b []byte) error

type ListTagPoliciesResponse

type ListTagPoliciesResponse struct {
	NextPageToken string `json:"next_page_token,omitempty"`

	TagPolicies []TagPolicy `json:"tag_policies,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListTagPoliciesResponse) MarshalJSON

func (s ListTagPoliciesResponse) MarshalJSON() ([]byte, error)

func (*ListTagPoliciesResponse) UnmarshalJSON

func (s *ListTagPoliciesResponse) UnmarshalJSON(b []byte) error

type TagAssignment added in v0.93.0

type TagAssignment struct {
	// The identifier of the entity to which the tag is assigned. For apps, the
	// entity_id is the app name
	EntityId string `json:"entity_id"`
	// The type of entity to which the tag is assigned. Allowed values are apps,
	// dashboards, geniespaces, notebooks
	EntityType string `json:"entity_type"`
	// The key of the tag. The characters , . : / - = and leading/trailing
	// spaces are not allowed
	TagKey string `json:"tag_key"`
	// The value of the tag. If the value is omitted, the tag is assigned with
	// its key only.
	TagValue string `json:"tag_value,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

A tag assignment attaches a tag, which is a key with an optional value, to a workspace object such as a dashboard, notebook, Genie space or app. An object can have at most one assignment for each tag key. If the key belongs to a governed tag, the caller needs the ASSIGN permission on that governed tag, and the value must be one of its allowed values. See https://docs.databricks.com/aws/en/admin/governed-tags/.

func (TagAssignment) MarshalJSON added in v0.93.0

func (s TagAssignment) MarshalJSON() ([]byte, error)

func (*TagAssignment) UnmarshalJSON added in v0.93.0

func (s *TagAssignment) UnmarshalJSON(b []byte) error

type TagPoliciesAPI

type TagPoliciesAPI struct {
	// contains filtered or unexported fields
}

The Tag Policy API allows you to manage policies for governed tags in Databricks. For Terraform usage, see the Tag Policy Terraform documentation. Permissions for tag policies can be managed using the Account Access Control Proxy API.

func NewTagPolicies

func NewTagPolicies(client *client.DatabricksClient) *TagPoliciesAPI

func (*TagPoliciesAPI) CreateTagPolicy

func (a *TagPoliciesAPI) CreateTagPolicy(ctx context.Context, request CreateTagPolicyRequest) (*TagPolicy, error)

func (*TagPoliciesAPI) DeleteTagPolicy

func (a *TagPoliciesAPI) DeleteTagPolicy(ctx context.Context, request DeleteTagPolicyRequest) error

func (*TagPoliciesAPI) GetTagPolicy

func (a *TagPoliciesAPI) GetTagPolicy(ctx context.Context, request GetTagPolicyRequest) (*TagPolicy, error)

func (*TagPoliciesAPI) ListTagPolicies

func (a *TagPoliciesAPI) ListTagPolicies(ctx context.Context, request ListTagPoliciesRequest) listing.Iterator[TagPolicy]

Lists the tag policies for all governed tags in the account. For Terraform usage, see the Tag Policy Terraform documentation. To list granted permissions for tag policies, use the Account Access Control Proxy API.

func (*TagPoliciesAPI) ListTagPoliciesAll

func (a *TagPoliciesAPI) ListTagPoliciesAll(ctx context.Context, request ListTagPoliciesRequest) ([]TagPolicy, error)

Lists the tag policies for all governed tags in the account. For Terraform usage, see the Tag Policy Terraform documentation. To list granted permissions for tag policies, use the Account Access Control Proxy API.

func (*TagPoliciesAPI) UpdateTagPolicy

func (a *TagPoliciesAPI) UpdateTagPolicy(ctx context.Context, request UpdateTagPolicyRequest) (*TagPolicy, error)

type TagPoliciesInterface

type TagPoliciesInterface interface {

	// Creates a new tag policy, making the associated tag key governed. For
	// Terraform usage, see the [Tag Policy Terraform documentation]. To manage
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	CreateTagPolicy(ctx context.Context, request CreateTagPolicyRequest) (*TagPolicy, error)

	// Deletes a tag policy by its associated governed tag's key, leaving that tag
	// key ungoverned. For Terraform usage, see the [Tag Policy Terraform
	// documentation].
	//
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	DeleteTagPolicy(ctx context.Context, request DeleteTagPolicyRequest) error

	// Gets a single tag policy by its associated governed tag's key. For Terraform
	// usage, see the [Tag Policy Terraform documentation]. To list granted
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/tag_policy
	GetTagPolicy(ctx context.Context, request GetTagPolicyRequest) (*TagPolicy, error)

	// Lists the tag policies for all governed tags in the account. For Terraform
	// usage, see the [Tag Policy Terraform documentation]. To list granted
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/tag_policies
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTagPolicies(ctx context.Context, request ListTagPoliciesRequest) listing.Iterator[TagPolicy]

	// Lists the tag policies for all governed tags in the account. For Terraform
	// usage, see the [Tag Policy Terraform documentation]. To list granted
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/tag_policies
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTagPoliciesAll(ctx context.Context, request ListTagPoliciesRequest) ([]TagPolicy, error)

	// Updates an existing tag policy for a single governed tag. For Terraform
	// usage, see the [Tag Policy Terraform documentation]. To manage permissions
	// for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	UpdateTagPolicy(ctx context.Context, request UpdateTagPolicyRequest) (*TagPolicy, error)
}

type TagPoliciesService deprecated

type TagPoliciesService interface {

	// Creates a new tag policy, making the associated tag key governed. For
	// Terraform usage, see the [Tag Policy Terraform documentation]. To manage
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	CreateTagPolicy(ctx context.Context, request CreateTagPolicyRequest) (*TagPolicy, error)

	// Deletes a tag policy by its associated governed tag's key, leaving that
	// tag key ungoverned. For Terraform usage, see the [Tag Policy Terraform
	// documentation].
	//
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	DeleteTagPolicy(ctx context.Context, request DeleteTagPolicyRequest) error

	// Gets a single tag policy by its associated governed tag's key. For
	// Terraform usage, see the [Tag Policy Terraform documentation]. To list
	// granted permissions for tag policies, use the [Account Access Control
	// Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/tag_policy
	GetTagPolicy(ctx context.Context, request GetTagPolicyRequest) (*TagPolicy, error)

	// Lists the tag policies for all governed tags in the account. For
	// Terraform usage, see the [Tag Policy Terraform documentation]. To list
	// granted permissions for tag policies, use the [Account Access Control
	// Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/tag_policies
	ListTagPolicies(ctx context.Context, request ListTagPoliciesRequest) (*ListTagPoliciesResponse, error)

	// Updates an existing tag policy for a single governed tag. For Terraform
	// usage, see the [Tag Policy Terraform documentation]. To manage
	// permissions for tag policies, use the [Account Access Control Proxy API].
	//
	// [Account Access Control Proxy API]: https://docs.databricks.com/api/workspace/accountaccesscontrolproxy
	// [Tag Policy Terraform documentation]: https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/tag_policy
	UpdateTagPolicy(ctx context.Context, request UpdateTagPolicyRequest) (*TagPolicy, error)
}

The Tag Policy API allows you to manage policies for governed tags in Databricks. For Terraform usage, see the Tag Policy Terraform documentation. Permissions for tag policies can be managed using the Account Access Control Proxy API.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type TagPolicy

type TagPolicy struct {
	// Timestamp when the tag policy was created
	CreateTime string `json:"create_time,omitempty"`
	// A description of the governed tag, such as its purpose or the meaning of
	// its values.
	Description string `json:"description,omitempty"`
	// The unique identifier of the tag policy, generated when the policy is
	// created.
	Id string `json:"id,omitempty"`
	// The tag key that this policy governs. Tag keys are case-sensitive.
	TagKey string `json:"tag_key"`
	// Timestamp when the tag policy was last updated
	UpdateTime string `json:"update_time,omitempty"`
	// The allowed values of the governed tag. Only these values can be assigned
	// to the tag key, and each value must be unique. A policy without values
	// defines a key-only governed tag.
	Values []Value `json:"values,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

A tag policy makes a tag key governed and defines the values that can be assigned to it. Governed tags are enforced across all workspaces in the account, and only users with the ASSIGN permission on the governed tag can assign it. See https://docs.databricks.com/aws/en/admin/governed-tags/.

func (TagPolicy) MarshalJSON

func (s TagPolicy) MarshalJSON() ([]byte, error)

func (*TagPolicy) UnmarshalJSON

func (s *TagPolicy) UnmarshalJSON(b []byte) error

type UpdateTagAssignmentRequest added in v0.93.0

type UpdateTagAssignmentRequest struct {
	// The identifier of the entity to which the tag is assigned. For apps, the
	// entity_id is the app name
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are apps,
	// dashboards, geniespaces, notebooks
	EntityType string `json:"-" url:"-"`

	TagAssignment TagAssignment `json:"tag_assignment"`
	// The key of the tag. The characters , . : / - = and leading/trailing
	// spaces are not allowed
	TagKey string `json:"-" url:"-"`
	// The comma-separated list of fields to update. Only `tag_value` can be
	// updated, because the entity type, entity ID and tag key identify the tag
	// assignment.
	UpdateMask string `json:"-" url:"update_mask"`
}

func (*UpdateTagAssignmentRequest) UnmarshalJSON added in v0.174.0

func (s *UpdateTagAssignmentRequest) UnmarshalJSON(b []byte) error

type UpdateTagPolicyRequest

type UpdateTagPolicyRequest struct {
	// The tag key that this policy governs. Tag keys are case-sensitive.
	TagKey string `json:"-" url:"-"`

	TagPolicy TagPolicy `json:"tag_policy"`
	// The comma-separated list of tag policy fields to update. When the mask
	// includes `values`, the values in the request replace all existing allowed
	// values.
	UpdateMask string `json:"-" url:"update_mask"`
}

func (*UpdateTagPolicyRequest) UnmarshalJSON added in v0.174.0

func (s *UpdateTagPolicyRequest) UnmarshalJSON(b []byte) error

type Value

type Value struct {
	// The value that can be assigned to the tag key. Values are case-sensitive.
	Name string `json:"name"`
}

An allowed value of a governed tag.

func (*Value) UnmarshalJSON added in v0.174.0

func (s *Value) UnmarshalJSON(b []byte) error

type WorkspaceEntityTagAssignmentsAPI added in v0.93.0

type WorkspaceEntityTagAssignmentsAPI struct {
	// contains filtered or unexported fields
}

Manage tag assignments on workspace-scoped objects.

func NewWorkspaceEntityTagAssignments added in v0.93.0

func NewWorkspaceEntityTagAssignments(client *client.DatabricksClient) *WorkspaceEntityTagAssignmentsAPI

func (*WorkspaceEntityTagAssignmentsAPI) CreateTagAssignment added in v0.93.0

func (a *WorkspaceEntityTagAssignmentsAPI) CreateTagAssignment(ctx context.Context, request CreateTagAssignmentRequest) (*TagAssignment, error)

func (*WorkspaceEntityTagAssignmentsAPI) DeleteTagAssignment added in v0.93.0

func (*WorkspaceEntityTagAssignmentsAPI) GetTagAssignment added in v0.93.0

func (*WorkspaceEntityTagAssignmentsAPI) ListTagAssignments added in v0.93.0

func (a *WorkspaceEntityTagAssignmentsAPI) ListTagAssignments(ctx context.Context, request ListTagAssignmentsRequest) listing.Iterator[TagAssignment]

List the tag assignments for an entity

func (*WorkspaceEntityTagAssignmentsAPI) ListTagAssignmentsAll added in v0.93.0

func (a *WorkspaceEntityTagAssignmentsAPI) ListTagAssignmentsAll(ctx context.Context, request ListTagAssignmentsRequest) ([]TagAssignment, error)

List the tag assignments for an entity

func (*WorkspaceEntityTagAssignmentsAPI) UpdateTagAssignment added in v0.93.0

type WorkspaceEntityTagAssignmentsInterface added in v0.93.0

type WorkspaceEntityTagAssignmentsInterface interface {

	// Create a tag assignment
	CreateTagAssignment(ctx context.Context, request CreateTagAssignmentRequest) (*TagAssignment, error)

	// Delete a tag assignment
	DeleteTagAssignment(ctx context.Context, request DeleteTagAssignmentRequest) error

	// Get a tag assignment
	GetTagAssignment(ctx context.Context, request GetTagAssignmentRequest) (*TagAssignment, error)

	// List the tag assignments for an entity
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTagAssignments(ctx context.Context, request ListTagAssignmentsRequest) listing.Iterator[TagAssignment]

	// List the tag assignments for an entity
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTagAssignmentsAll(ctx context.Context, request ListTagAssignmentsRequest) ([]TagAssignment, error)

	// Update a tag assignment
	UpdateTagAssignment(ctx context.Context, request UpdateTagAssignmentRequest) (*TagAssignment, error)
}

type WorkspaceEntityTagAssignmentsService deprecated added in v0.93.0

type WorkspaceEntityTagAssignmentsService interface {

	// Create a tag assignment
	CreateTagAssignment(ctx context.Context, request CreateTagAssignmentRequest) (*TagAssignment, error)

	// Delete a tag assignment
	DeleteTagAssignment(ctx context.Context, request DeleteTagAssignmentRequest) error

	// Get a tag assignment
	GetTagAssignment(ctx context.Context, request GetTagAssignmentRequest) (*TagAssignment, error)

	// List the tag assignments for an entity
	ListTagAssignments(ctx context.Context, request ListTagAssignmentsRequest) (*ListTagAssignmentsResponse, error)

	// Update a tag assignment
	UpdateTagAssignment(ctx context.Context, request UpdateTagAssignmentRequest) (*TagAssignment, error)
}

Manage tag assignments on workspace-scoped objects.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL