Skip to content

Core CRUD resource flows#3

Draft
JSYoo5B wants to merge 21 commits into
mainfrom
codex/02-core-crud-resources
Draft

Core CRUD resource flows#3
JSYoo5B wants to merge 21 commits into
mainfrom
codex/02-core-crud-resources

Conversation

@JSYoo5B

@JSYoo5B JSYoo5B commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds initial Gophercloud-compatible resource flows for Image, Network, Volume, and Compute.
  • Covers create, list, get, and delete behavior where this slice introduces state.
  • Adds an API-level flow test for the Phase 2 core resources.

Main Review Points

  • Image CRUD handlers and DTO mapping.
  • Network, subnet, and port CRUD surfaces.
  • Volume and compute server default flows.

Verification

  • go test ./...

})
}

func (h Handler) createImage(w http.ResponseWriter, r *http.Request) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This is the representative handler shape for the first CRUD slice: decode the OpenStack wire request, convert to an app input, call the app service, then map back to a response DTO. Similar handlers in network, volume, and compute can be reviewed against this pattern.

}

func (h Handler) getImage(w http.ResponseWriter, r *http.Request) {
image, err := h.service.Get(chi.URLParam(r, "image_id"))

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

API handlers translate app-layer not-found errors into OpenStack-style HTTP responses here. This keeps storage/domain error details out of the wire DTO layer.

return servers
}

func (s *Service) CreateServer(input CreateServer) Server {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This early slice still keeps state directly in the service. That is intentional for the first working API surface, but it is also the pressure point that the later repository-boundary PR extracts.

return Flavor{}, ErrFlavorNotFound
}

func (s *Service) ListServers() []Server {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The ids slice preserves deterministic list order separately from the map lookup path. The same ordering concern shows up again in repository implementations.

@JSYoo5B JSYoo5B marked this pull request as draft July 2, 2026 21:08
Base automatically changed from codex/01-direction-service-skeletons to main July 4, 2026 17:34
@JSYoo5B JSYoo5B force-pushed the codex/02-core-crud-resources branch from 9964df1 to 791c424 Compare July 4, 2026 17:39
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.

1 participant