Skip to content

Conversation

@rubys
Copy link
Contributor

@rubys rubys commented Aug 27, 2025

Summary

  • Replace GraphQL-based IP address operations with REST API implementations using the flaps Machines API
  • Add new flaps/flaps_ips.go with client methods for listing, assigning, and releasing IP addresses
  • Remove legacy GraphQL IP operations from resource_ip_addresses.go and related types
  • Add new flaps action types for IP assignment operations

Changes

  • Added: flaps/flaps_ips.go - New REST API client for IP operations with methods:
    • ListIPAssignments() - List all IP assignments for an app
    • AssignIPAddress() - Assign a new IP address to an app
    • ReleaseIPAddress() - Release an IP address from an app
  • Modified: flaps/actions.go and flaps/flapsaction_string.go - Added new action types for IP assignment operations
  • Removed: resource_ip_addresses.go - Legacy GraphQL-based IP operations
  • Removed: GraphQL IP-related types from types.go

Benefits

  • Performance: REST API calls are typically faster than GraphQL queries
  • Consistency: Aligns IP operations with other flaps Machines API operations
  • Maintainability: Reduces GraphQL schema dependencies
  • Simplicity: Cleaner API surface with focused REST endpoints

Test plan

  • Test IP address listing functionality
  • Test IP address assignment for different types (v4, v6, shared)
  • Test IP address release functionality
  • Verify error handling and edge cases
  • Ensure backward compatibility where needed

🤖 Generated with Claude Code

rubys and others added 3 commits August 27, 2025 10:43
Replace GraphQL-based IP address operations with REST API implementations:

- Add flaps/flaps_ips.go with new REST API client methods for IP operations
- Add new flaps actions: ipAssignmentsList, ipAssignmentCreate, ipAssignmentDelete
- Remove resource_ip_addresses.go with legacy GraphQL IP operations
- Remove GraphQL IP-related types from types.go

This migration improves performance and consistency by using the flaps Machines API
instead of GraphQL for IP address management operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix golangci-lint-action config: change skip-pkg-cache to skip-cache
- Remove trailing whitespace from flaps/flaps_ips.go
- Add newline at end of flaps/flaps_ips.go
- Fix goimports formatting in types.go
- Fix staticcheck SA1006: use errors.New instead of fmt.Errorf

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The previous migration commit (4bbe41c) migrated regular IP assignment operations
from GraphQL to REST API but inadvertently removed GraphQL-based egress IP
operations that are still needed:

- Restore AllocateEgressIPAddress() for allocating machine egress IPs
- Restore GetEgressIPAddresses() for retrieving machine egress IPs
- Restore ReleaseEgressIPAddress() for releasing machine egress IPs
- Add missing GraphQL types and Query struct fields

These egress IP operations are separate from regular IP assignments and still
require GraphQL API access.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants