Skip to content

feat: add blueprint API and rename server group name to server base name#12

Open
frederickbaier wants to merge 1 commit intofeat/platformfrom
feat/blueprint-api
Open

feat: add blueprint API and rename server group name to server base name#12
frederickbaier wants to merge 1 commit intofeat/platformfrom
feat/blueprint-api

Conversation

@frederickbaier
Copy link
Copy Markdown

Description

Adds a new top-level management API for blueprints — reusable runtime/software templates that groups and persistent servers can use as their base source configuration. The controller already exposes the underlying REST endpoints; this PR wires them into the Java SDK so consumers can create, list, update, and delete blueprints without dropping down to the generated OpenAPI client.

At the same time, the server query filter is generalized from "server group name" to "server base name". The same filter now matches either a persistent server name or a group name, so keeping the old serverGroupName naming was actively misleading. A new getServerByName(serverName, splitChar) helper is added so callers can resolve a runtime server name (e.g. Lobby-1) in a single call instead of parsing the suffix themselves.

Changes

  • New BlueprintApi interface with getBlueprintById, getBlueprintByName, getAllBlueprints, createBlueprint, updateBlueprint, deleteBlueprint, backed by BlueprintApiImpl against the generated BlueprintsApi client.
  • New CreateBlueprintRequest and UpdateBlueprintRequest builders (name, configurator, Minecraft version, server software, server URL, software version, runtime config, workflow steps).
  • CloudApi / CloudApiImpl expose blueprint(); CacheEventListener invalidates blueprint cache keys on create/update/delete events; EntityType.BLUEPRINT and a blueprint(s) prefix added to QueryKey.
  • ServerQuery: serverGroupNames field and filterByServerGroupName renamed to serverBaseNames / filterByServerBaseName. Old names kept as @Deprecated pass-throughs.
  • ServerApi: getServersByGroup deprecated in favor of getServersByServerBaseName; getServerByNumericalId parameter renamed to serverBaseName; new getServerByName(serverName, splitChar) that splits the name, queries by base name + numerical ID, and falls back to a persistent-server match when numerical ID is -1.
  • QueryCache / QueryKey javadoc examples updated from "group" to "serverBaseName" to match the new key shape.

Type of Change

  • New feature / capability
  • Bug fix
  • Refactoring
  • Documentation
  • Infrastructure / CI/CD

Behavior Change

Before:

  • No SDK surface for blueprints — callers had to use the generated BlueprintsApi directly and manage their own cache keys.
  • ServerQuery.filterByServerGroupName(...) could only be reasoned about as filtering by group, even though the controller also matched persistent server names.
  • Resolving a runtime server name like Lobby-1 required the caller to split the string and call getServerByNumericalId(group, id) themselves.

After:

  • cloudApi.blueprint().createBlueprint(...) / updateBlueprint / deleteBlueprint / getAllBlueprints are first-class and participate in the shared QueryCache (invalidated on blueprint create/update/delete events).
  • ServerQuery.filterByServerBaseName(...) explicitly matches either persistent server name or group name; the old method still works but is @Deprecated.
  • serverApi.getServerByName(\"Lobby-1\", '-') returns the right server without the caller parsing the suffix; exact matches beat fallbacks, and a name with no suffix is treated as a persistent server lookup.

No breaking changes at the source level — all renamed methods have deprecated default/pass-through shims.

Pre-Deployment Migrations

No migrations required before deploying. The controller already serves the blueprint endpoints; this PR only adds a client-side wrapper. The serverBaseName rename is a source-compatible refactor.

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