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

upcoming: [M3-9422] -Update existing API endpoints and types for /v4/nodebalancers #11811

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

harsh-akamai
Copy link
Contributor

Description 📝

Updates existing /v4/nodebalancers endpoints for NB-VPC Integration

How to test 🧪

  • confirm changes match API spec
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@harsh-akamai harsh-akamai self-assigned this Mar 10, 2025
@harsh-akamai harsh-akamai marked this pull request as ready for review March 11, 2025 06:51
@harsh-akamai harsh-akamai requested a review from a team as a code owner March 11, 2025 06:51
@harsh-akamai harsh-akamai requested review from cpathipa and pmakode-akamai and removed request for a team March 11, 2025 06:51
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

This PR is technically M3-9421 and M3-9422, right?

We don't currently have or use the /v4/nodebalancers/{nodeBalancerId}/configs/{configId}/rebuild endpoint, but I think it'd be worth adding the non-beta and beta versions.

I know you mentioned the /v4/vpcs endpoint work was still pending on the back-end -- is that inclusive of the /v4/nodebalancers/{id}/vpcs ones?

'@linode/api-v4': Upcoming Features
---

Add `/v4beta/nodebalancers` endpoints for NB-VPC Integration ([#11811](https://github.com/linode/manager/pull/11811))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Add `/v4beta/nodebalancers` endpoints for NB-VPC Integration ([#11811](https://github.com/linode/manager/pull/11811))
Add and update `/v4beta/nodebalancers` endpoints for NB-VPC Integration ([#11811](https://github.com/linode/manager/pull/11811))

Comment on lines 34 to 48
/**
* getNodeBalancerConfigNodesBeta
*
* Returns a paginated list of nodes for the specified NodeBalancer configuration profile.
* These are the backends that will be sent traffic for this port.
* Requires the NB-VPC feature flag to be enabled
*
* Note: Returns the vpc_config_id incase of a VPC backend
*
* duplicated function of getNodeBalancerConfigNodes
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need so much explanation here; using /v4beta endpoints is a well-established pattern by now in this package for upcoming features

Suggested change
/**
* getNodeBalancerConfigNodesBeta
*
* Returns a paginated list of nodes for the specified NodeBalancer configuration profile.
* These are the backends that will be sent traffic for this port.
* Requires the NB-VPC feature flag to be enabled
*
* Note: Returns the vpc_config_id incase of a VPC backend
*
* duplicated function of getNodeBalancerConfigNodes
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
*/
/**
* getNodeBalancerConfigNodesBeta
*
* Returns a paginated list of nodes for the specified NodeBalancer configuration profile from the beta API.
* Note: Returns the vpc_config_id in case of a VPC backend
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
*/

Comment on lines 87 to 100
/**
* getNodeBalancerConfigNodeBeta
*
* Returns details about a specific node for the given NodeBalancer configuration profile.
*
* Note: Returns the vpc_config_id incase of a VPC backend
*
* duplicated function of getNodeBalancerConfigNode
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
* @param nodeId { number } The Node to be retrieved.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* getNodeBalancerConfigNodeBeta
*
* Returns details about a specific node for the given NodeBalancer configuration profile.
*
* Note: Returns the vpc_config_id incase of a VPC backend
*
* duplicated function of getNodeBalancerConfigNode
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
* @param nodeId { number } The Node to be retrieved.
*/
/**
* getNodeBalancerConfigNodeBeta
*
* Returns details about a specific node for the given NodeBalancer configuration profile from the beta API.
*
* Note: Returns the vpc_config_id in case of a VPC backend
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to retrieve nodes for.
* @param nodeId { number } The Node to be retrieved.
*/

Comment on lines 155 to 166
/**
* createNodeBalancerConfigNode
*
* Creates a NodeBalancer Node, a backend that can accept traffic for
* this NodeBalancer Config. Nodes are routed requests on the configured port based on their status.
* Requires the NB-VPC feature flag to be enabled
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* createNodeBalancerConfigNode
*
* Creates a NodeBalancer Node, a backend that can accept traffic for
* this NodeBalancer Config. Nodes are routed requests on the configured port based on their status.
* Requires the NB-VPC feature flag to be enabled
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*/
/**
* createNodeBalancerConfigNodeBeta
*
* Creates a NodeBalancer Node, a backend that can accept traffic for
* this NodeBalancer Config. Nodes are routed requests on the configured port based on their status.
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* @param nodeBalancerId { number } The ID of the NodeBalancer the config belongs to.
* @param configId { number } The configuration profile to add a node to.
* @param data
*/

Comment on lines 78 to 91
/**
* createNodeBalancerConfig
*
* Creates a NodeBalancer Config, which allows the NodeBalancer to accept traffic on a new port.
* You will need to add NodeBalancer Nodes to the new Config before it can actually serve requests.
* Requires the NB-VPC feature flag to be enabled
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The NodeBalancer to receive the new config.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* createNodeBalancerConfig
*
* Creates a NodeBalancer Config, which allows the NodeBalancer to accept traffic on a new port.
* You will need to add NodeBalancer Nodes to the new Config before it can actually serve requests.
* Requires the NB-VPC feature flag to be enabled
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*
* @param nodeBalancerId { number } The NodeBalancer to receive the new config.
*/
/**
* createNodeBalancerConfigBeta
*
* Creates a NodeBalancer Config, which allows the NodeBalancer to accept traffic on a new port.
* You will need to add NodeBalancer Nodes to the new Config before it can actually serve requests.
*
* Note: The BETA version accepts a Node's VPC IP address and subnet-id
*
* @param nodeBalancerId { number } The NodeBalancer to receive the new config.
*/

Comment on lines 98 to 106
/**
* createNodeBalancer
*
* Create a NodeBalancer within a VPC with the BETA version
* Requires the NB-VPC feature flag to be enabled
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* createNodeBalancer
*
* Create a NodeBalancer within a VPC with the BETA version
* Requires the NB-VPC feature flag to be enabled
*
* duplicated function of createNodeBalancer
* necessary to call BETA_API_ROOT in a separate function based on the feature flag
*/
/**
* createNodeBalancerBeta
*
* Add a NodeBalancer to your account using the beta API
*/

@harsh-akamai harsh-akamai changed the title upcoming: [M3-9422] - Update existing API endpoints and types for /v4/nodebalancers upcoming: [M3-9421, M3-9422] - Add & Update existing API endpoints and types for /v4/nodebalancers Mar 12, 2025
@harsh-akamai harsh-akamai changed the title upcoming: [M3-9421, M3-9422] - Add & Update existing API endpoints and types for /v4/nodebalancers upcoming: [ M3-9422] -Update existing API endpoints and types for /v4/nodebalancers Mar 12, 2025
@harsh-akamai harsh-akamai changed the title upcoming: [ M3-9422] -Update existing API endpoints and types for /v4/nodebalancers upcoming: [M3-9422] -Update existing API endpoints and types for /v4/nodebalancers Mar 12, 2025
Copy link

Coverage Report:
Base Coverage: 80.1%
Current Coverage: 80.11%

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 2 failing tests on test run #3 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing534 Passing3 Skipped111m 14s

Details

Failing Tests
SpecTest
linode-config.spec.tsEnd-to-End » Clones a config
edit-user-alert.spec.tsIntegration Tests for Edit Alert » should correctly display the details of the alert in the Edit Alert page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/linode-config.spec.ts,cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts"

@harsh-akamai
Copy link
Contributor Author

harsh-akamai commented Mar 12, 2025

This PR is technically M3-9421 and M3-9422, right?

This covers only M3-9422. I've only added /v4beta endpoints for all the existing ones

We don't currently have or use the /v4/nodebalancers/{nodeBalancerId}/configs/{configId}/rebuild endpoint, but I think it'd be worth adding the non-beta and beta versions.

I know you mentioned the /v4/vpcs endpoint work was still pending on the back-end -- is that inclusive of the /v4/nodebalancers/{id}/vpcs ones?

So the /rebuild and /nodebalancers/{id}/vpcs endpoints are new(as per the CM codebase) so I've covered it in a different PR (here).

The endpoints under/v4/vpcs are pending. Everything under /v4(beta)/nodebalancers are covered in these 2 PRs
cc: @dwiley-akamai

@dwiley-akamai dwiley-akamai added the NB-VPC Relating to NodeBalancer-VPC integration label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NB-VPC Relating to NodeBalancer-VPC integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants