tags

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

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"`
}

type CreateTagPolicyRequest

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

type DeleteTagAssignmentRequest added in v0.93.0

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

type DeleteTagPolicyRequest

type DeleteTagPolicyRequest struct {
	TagKey string `json:"-" url:"-"`
}

type GetTagAssignmentRequest added in v0.93.0

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

type GetTagPolicyRequest

type GetTagPolicyRequest struct {
	TagKey string `json:"-" url:"-"`
}

type ListTagAssignmentsRequest added in v0.93.0

type ListTagAssignmentsRequest struct {
	// The identifier of the entity to which the tag is assigned
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are
	// dashboards, geniespaces
	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
	EntityId string `json:"entity_id"`
	// The type of entity to which the tag is assigned. Allowed values are
	// dashboards, geniespaces
	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
	TagValue string `json:"tag_value,omitempty"`

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

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"`

	Description string `json:"description,omitempty"`

	Id string `json:"id,omitempty"`

	TagKey string `json:"tag_key"`
	// Timestamp when the tag policy was last updated
	UpdateTime string `json:"update_time,omitempty"`

	Values []Value `json:"values,omitempty"`

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

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
	EntityId string `json:"-" url:"-"`
	// The type of entity to which the tag is assigned. Allowed values are
	// dashboards, geniespaces
	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 field mask must be a single string, with multiple fields separated by
	// commas (no spaces). The field path is relative to the resource object,
	// using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`).
	// Specification of elements in sequence or map fields is not allowed, as
	// only the entire collection field can be specified. Field names must
	// exactly match the resource field names.
	//
	// A field mask of `*` indicates full replacement. It’s recommended to
	// always explicitly list the fields being updated and avoid using `*`
	// wildcards, as it can lead to unintended results if the API changes in the
	// future.
	UpdateMask string `json:"-" url:"update_mask"`
}

type UpdateTagPolicyRequest

type UpdateTagPolicyRequest struct {
	TagKey string `json:"-" url:"-"`

	TagPolicy TagPolicy `json:"tag_policy"`
	// The field mask must be a single string, with multiple fields separated by
	// commas (no spaces). The field path is relative to the resource object,
	// using a dot (`.`) to navigate sub-fields (e.g., `author.given_name`).
	// Specification of elements in sequence or map fields is not allowed, as
	// only the entire collection field can be specified. Field names must
	// exactly match the resource field names.
	//
	// A field mask of `*` indicates full replacement. It’s recommended to
	// always explicitly list the fields being updated and avoid using `*`
	// wildcards, as it can lead to unintended results if the API changes in the
	// future.
	UpdateMask string `json:"-" url:"update_mask"`
}

type Value

type Value struct {
	Name string `json:"name"`
}

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 (a *WorkspaceEntityTagAssignmentsAPI) DeleteTagAssignment(ctx context.Context, request DeleteTagAssignmentRequest) error

func (*WorkspaceEntityTagAssignmentsAPI) GetTagAssignment added in v0.93.0

func (a *WorkspaceEntityTagAssignmentsAPI) GetTagAssignment(ctx context.Context, request GetTagAssignmentRequest) (*TagAssignment, error)

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

func (a *WorkspaceEntityTagAssignmentsAPI) UpdateTagAssignment(ctx context.Context, request UpdateTagAssignmentRequest) (*TagAssignment, error)

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