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

Add Link API docs #20308

Merged
merged 13 commits into from
Jan 25, 2024
Merged

Add Link API docs #20308

merged 13 commits into from
Jan 25, 2024

Conversation

NickCellino
Copy link
Contributor

@NickCellino NickCellino commented Jan 22, 2024

Description

This adds API docs for the new HCP Consul Central Link API. It includes sections for:

  1. Create/update link
  2. Read link
  3. Delete link

I have also added a new section in the API Structure document that points out the header that we are now adding to every request (#20220).

Testing & Reproduction steps

I used the instructions here to run this locally so I could view the docs: https://github.com/hashicorp/consul/tree/main/website#with-node

Links

https://hashicorp.atlassian.net/browse/CC-7133

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@NickCellino NickCellino marked this pull request as ready for review January 22, 2024 22:31
@NickCellino NickCellino requested a review from a team as a code owner January 22, 2024 22:31
@NickCellino NickCellino requested a review from mkam January 22, 2024 22:32

| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
| ---------------- | --------------------- | ------------- | ------------------------------ |
| `NO` | `stale`, `consistent` | `none` | `operator:write`, `acl:write` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a question about this table (and the similar ones below) that I asked in a thread here. This is my best guess at filling out this table but not sure if it's correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an expert in this area, but it looks fine to me.

{
"data": {
"resourceId": "organization/c0bf7aac-7690-4905-a8aa-889df1510314/project/6e82a47b-79af-4920-ad42-c0f74421ab52/hashicorp.consul.global-network-manager.cluster/my-cluster",
"clientId": "3jz6zk2tlr802htzwquczlxlsrohlpm5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clientId/clientSecret I used here are random strings I generated and pasted in place of the real ones that I used to generate these samples.

Copy link
Contributor

@im2nguyen im2nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this looks good!

can you also add a brief description to the main api docs overview page? id suggest putting it in "manage consul" or creating a section dedicated to hcpc

website/content/api-docs/hcp-link.mdx Outdated Show resolved Hide resolved
Comment on lines 89 to 94
### Link API vs. Configuration-based Linking

The Link API described here is an alternative method to accomplish the same thing as [configuration-based linking](/consul/docs/agent/config/config-files#self-managed-hcp-parameters). You should generally only choose one method or the other for linking your cluster, not both. If you do use both methods, they interract in the following ways:

* Values set in the configuration will take precedence over what was set in the API/CLI when Consul is started.
* SMCC can only be unlinked by the API/CLI, regardless of if they were established via configuration or API/CLI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would move this to the top (right above the json request body schema) since this is something you want to read/know about before you use the endpoint

---

# Link HTTP API

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a one sentence description of this endpoint ( /api/hcp/v2/link/global)

for example, this is one for the events endpoint:

The /event endpoints fire new events and to query the available events in Consul.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

The `/api/hcp/v2/link/global` endpoint allows you to link your Consul cluster to HCP Consul Central.

website/content/api-docs/hcp-link.mdx Outdated Show resolved Hide resolved
website/content/api-docs/hcp-link.mdx Outdated Show resolved Hide resolved

| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
| ---------------- | --------------------- | ------------- | ------------------------------ |
| `NO` | `stale`, `consistent` | `none` | `operator:write`, `acl:write` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an expert in this area, but it looks fine to me.

website/content/api-docs/hcp-link.mdx Outdated Show resolved Hide resolved
website/content/api-docs/hcp-link.mdx Outdated Show resolved Hide resolved
NickCellino and others added 5 commits January 24, 2024 13:52
Co-authored-by: Melissa Kam <3768460+mkam@users.noreply.github.com>
Co-authored-by: Melissa Kam <3768460+mkam@users.noreply.github.com>
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
@NickCellino NickCellino force-pushed the nickcellino/linking-api-docs branch from 3a63bf3 to a7832f0 Compare January 24, 2024 19:22
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
@NickCellino NickCellino merged commit 4801c9c into main Jan 25, 2024
92 checks passed
@NickCellino NickCellino deleted the nickcellino/linking-api-docs branch January 25, 2024 15:13
@david-yu
Copy link
Contributor

david-yu commented Feb 6, 2024

FYI docs do not need changelings @NickCellino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants