Skip to content

[RFD] API Tagging #79

@jsollom-hpe

Description

@jsollom-hpe

API Tagging

What do you propose?

Tagging is a well-known concept which is widely utilized across the industry. Its main purpose is to allow various policies or presentation filters to be applied across services and resource types. This guideline is meant to introduce uniform tagging to allow for the creation of tags-based policies across different services.

Each service would be responsible for providing endpoints to CRUD (create, read, update, and delete) tags on the resources it provides.

Tag Structure

  • A tag is a key-value pair of character strings that can be attached to the resource by either a user or a service.
  • Users of this API MUST not be able to edit or remove service-originated tag, indicated with the prepended string 'internal:'.
  • Resources that support tagging MUST support up to 50 user-originated tags per resource. Number of service-originated tags is not restricted.
  • Tags MUST be stored by preserving input case sensitivity. However, tag keys and values are considered case insensitive. This means if a given resource has the tag "location" : "San Jose" then the same resource MUST NOT have "Location" : "New York" tag as it is considered the same key.
  • Search on the tags MUST be case insensitive. For REST API implementation for tags please refer to query parameters specific for tags in API Standard .
  • For a given resource, there can only be one value for a particular tag key.
  • Tag key MUST have 1-128 characters.
  • Tag value can have a maximum of 256 characters, but they are allowed to be an empty string.
  • Allowed characters for both keys and values are letters, numbers, spaces representable in UTF-8, and the following characters: _ . : = + - @
  • Null is not an allowed value. Instead, empty string ("") MUST be supported to enable 'label' semantics.
  • Tags MUST NOT be used to store sensitive data, such as personally identifiable information.
  • Service-originated tags MUST start with a prefix "internal:". User-defined tags MUST NOT start with the "internal:" prefix.
    • A registry of prefix namespaces should be managed alongside this standard for services to reserve and use for their corresponding service-originated tags. For example: "internal:sdwan:", "internal:backups:", etc.

Tagging Implementation Responsibilities

  • Tags MUST be stored and presented in the context of the specific resource and MUST NOT have an independent lifecycle i.e. tags cannot be created, updated or deleted as standalone entities.
  • Services own the APIs for tagging (& untagging) resources and for querying the resources based on tags.
  • Events MUST be published by the services whenever any tag is modified on any resource.

Related RFDs

Establishment of an API Contract specification for OpenCHAMI

  • This RFD should be part of the API contract specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfdRequest for Discussion

    Type

    No type

    Projects

    Status

    Inbox

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions