Add Mosaic API coverage: data models, workspaces, smart attributes, settings - #255
Closed
aidan-codes-stuff wants to merge 2 commits into
Closed
Add Mosaic API coverage: data models, workspaces, smart attributes, settings#255aidan-codes-stuff wants to merge 2 commits into
aidan-codes-stuff wants to merge 2 commits into
Conversation
…ettings Adds full SDK coverage for the Mosaic (semantic layer) REST API surface — 90 operations previously unavailable in mstrio-py: - mstrio/api/data_models.py: 64 wrappers for /api/model/dataModels/* and /api/dataModels/* (model lifecycle, tables, attributes, metrics, fact metrics, folders, links, external data models, security filters, object ACLs/translations, YAML export/restore, publish + status polling) - mstrio/api/workspaces.py: 13 wrappers for /api/dataServer/workspaces/* (workspaces, pipelines, pipeline tables) - mstrio/api/smart_attributes.py: 6 wrappers for smart attributes - mstrio/api/mosaic.py: 4 wrappers for Mosaic SSO admin settings - High-level classes: DataModel + DataModelTable/Attribute/Metric/ FactMetric/SecurityFilter (mstrio.modeling.data_model), Workspace/ Pipeline/PipelineTable (mstrio.project_objects), SmartAttribute, MosaicSsoSettings; all version-gated at 11.6.0100 - code_snippets for each module; README and NEWS entries Modeling writes support both self-managed changesets (default) and a caller-owned changeset_id, because servers enforce a minimum committable model: at least one table per model (8004e46f), at least one attribute or metric per table (8004e42f), and displays on every attribute (8004cf06). DataModel.create(tables=..., attributes=...) builds that minimum shape in a single changeset, resolving by-name logical-table references. Runtime endpoints always send X-MSTR-ProjectID (required by ERR006 even with a project selected on the session). Validated against the public OpenAPI specification (endpoint conformance in both directions per module) and live against a Strategy One 11.6.0500 cloud environment (full create/alter/publish/delete lifecycle on scratch objects). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MstrException takes an err_data dict, not a message string — the previous
code raised AttributeError ('str' object has no attribute 'get') instead
of the real publish error. Timeouts now raise MstrTimeoutError. Also
documents two field-verified publish behaviors: connect_live models reject
the publish trigger (ERR006), and the per-instance publishStatus can stay
at 1 after the cube has finished loading (cross-check cubes.status).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
|
Dedicated module for Mosaic Model will come in 26.07 release cycle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full SDK coverage for the Mosaic (semantic layer) REST API surface — 90 operations currently unavailable in mstrio-py:
mstrio/api/data_models.py/api/model/dataModels/*+/api/dataModels/*: model lifecycle, tables, attributes, metrics, fact metrics, folders, links, external data models (data mesh), security filters, object ACLs/translations, YAML export/restore, publish + status pollingmstrio/api/workspaces.py/api/dataServer/workspaces/*: workspaces, pipelines, pipeline tablesmstrio/api/smart_attributes.pymstrio/api/mosaic.pyHigh-level classes follow the established Entity/mixin conventions and are version-gated at
11.6.0100:DataModel+DataModelTable/DataModelAttribute/DataModelMetric/DataModelFactMetric/DataModelSecurityFilterinmstrio.modeling.data_model, withlist_data_modelsand per-componentlist_*functionsWorkspace/Pipeline/PipelineTableinmstrio.project_objectsSmartAttributeinmstrio.modeling.schema.attributeMosaicSsoSettings+ module functions inmstrio.servercode_snippets/example per module; README and NEWS updatedDesign notes
mstrio.api.attributes), and additionally accept a caller-ownedchangeset_id. This is necessary because the server enforces a minimum committable model: at least one table per model (8004e46f), at least one attribute or metric per table (8004e42f), anddisplayson every attribute (8004cf06).DataModel.create(tables=..., attributes=...)builds that minimum shape in a single changeset and resolves by-name logical-table references in attribute bodies, so callers are not exposed to the create-order id chicken-and-egg.DataModel.publish()wraps the full three-step runtime flow (create instance → publish with per-table refresh policies → pollpublishStatus), since the publish POST returns 204 fire-and-forget./api/dataModels/*,/api/dataServer/*) always sendX-MSTR-ProjectID(defaulted from the connection) — several reject its absence withERR006even when a project is selected on the session.export_data_modelreturnsapplication/yamland is handled without the JSONErrorHandler;restore_data_modelandupload_mosaic_keytabuse the multipart idiom frommstrio.api.migration.Testing
black/isort/flake8clean with the repo configuration;import mstrioandcompileallclean on Python 3.12.A companion GitHub Issue will reference this PR per the contribution guidelines.
🤖 Generated with Claude Code