Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept ap, datacenter, and namespace query params #17525

Merged

Conversation

jkirschner-hashicorp
Copy link
Contributor

@jkirschner-hashicorp jkirschner-hashicorp commented May 31, 2023

This commit only contains the OSS PR (datacenter query param support). A separate enterprise PR adds support for ap and namespace query params.

Resources in Consul can exists within scopes such as datacenters, cluster peers, admin partitions, and namespaces. You can refer to those resources from interfaces such as the CLI, HTTP API, DNS, and configuration files.

Some scope levels have consistent naming: cluster peers are always referred to as "peer".

Other scope levels use a short-hand in DNS lookups...

  • "ns" for namespace
  • "ap" for admin partition
  • "dc" for datacenter

...But use long-hand in CLI commands:

  • "namespace" for namespace
  • "partition" for admin partition
  • and "datacenter"

However, HTTP API query parameters do not follow a consistent pattern, supporting short-hand for some scopes but long-hand for others:

  • "ns" for namespace
  • "partition" for admin partition
  • and "dc" for datacenter.

This inconsistency is confusing, especially for users who have been exposed to providing scope names through another interface such as CLI or DNS queries.

This commit improves UX by consistently supporting both short-hand and long-hand forms of the namespace, partition, and datacenter scopes in HTTP API query parameters.

PR Checklist

  • updated test coverage
  • external facing docs updated - will do in a separate PR post code freeze
  • appropriate backport labels added
  • not a security concern

This commit only contains the OSS PR (datacenter query param support).
A separate enterprise PR adds support for ap and namespace query params.

Resources in Consul can exists within scopes such as datacenters, cluster
peers, admin partitions, and namespaces. You can refer to those resources from
interfaces such as the CLI, HTTP API, DNS, and configuration files.

Some scope levels have consistent naming: cluster peers are always referred to
as "peer".

Other scope levels use a short-hand in DNS lookups...
- "ns" for namespace
- "ap" for admin partition
- "dc" for datacenter

...But use long-hand in CLI commands:
- "namespace" for namespace
- "partition" for admin partition
- and "datacenter"

However, HTTP API query parameters do not follow a consistent pattern,
supporting short-hand for some scopes but long-hand for others:
- "ns" for namespace
- "partition" for admin partition
- and "dc" for datacenter.

This inconsistency is confusing, especially for users who have been exposed to
providing scope names through another interface such as CLI or DNS queries.

This commit improves UX by consistently supporting both short-hand and
long-hand forms of the namespace, partition, and datacenter scopes in HTTP API
query parameters.
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface labels May 31, 2023
@jkirschner-hashicorp jkirschner-hashicorp merged commit b9c9d79 into main May 31, 2023
@jkirschner-hashicorp jkirschner-hashicorp deleted the improve-scope-query-param-naming-support-oss branch May 31, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants