Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Change Log
----------

..
All enhancements and patches to blockstore will be documented
in this file. It adheres to the structure of https://keepachangelog.com/ ,
but in reStructuredText instead of Markdown (for ease of incorporation into
Sphinx documentation and the PyPI description).

This project adheres to Semantic Versioning (https://semver.org/).

.. There should always be an "Unreleased" section for changes pending release.

Unreleased
~~~~~~~~~~

*

[1.1.0] - 2021-10-25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Added
_____

* Move apps/api to apps/rest_api.
* Copy edx-platform/openedx/core/lib/blockstore_api to blockstore/apps/api.
This code has been copied over so it is easier to review the Python API
implementation in development.
* Make code into an installable package.
5 changes: 5 additions & 0 deletions blockstore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Blockstore is a system for storing educational content.
"""

__version__ = '1.1.0'
57 changes: 57 additions & 0 deletions blockstore/apps/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"""
API Client for Blockstore

This API does not do any caching; consider using BundleCache or (in
openedx.core.djangolib.blockstore_cache) together with these API methods for
improved performance.
"""
from .models import (
Collection,
Bundle,
Draft,
BundleFile,
DraftFile,
LinkReference,
LinkDetails,
DraftLinkDetails,
)
from .methods import (
# Collections:
get_collection,
create_collection,
update_collection,
delete_collection,
# Bundles:
get_bundles,
get_bundle,
create_bundle,
update_bundle,
delete_bundle,
# Drafts:
get_draft,
get_or_create_bundle_draft,
write_draft_file,
set_draft_link,
commit_draft,
delete_draft,
# Bundles or drafts:
get_bundle_files,
get_bundle_files_dict,
get_bundle_file_metadata,
get_bundle_file_data,
get_bundle_version,
get_bundle_version_files,
# Links:
get_bundle_links,
get_bundle_version_links,
# Misc:
force_browser_url,
)
from .exceptions import (
BlockstoreException,
CollectionNotFound,
BundleNotFound,
DraftNotFound,
BundleFileNotFound,
BundleStorageError,
)
9 changes: 9 additions & 0 deletions blockstore/apps/api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
""" AppConfig for API app. """

from django.apps import AppConfig


class ApiConfig(AppConfig):
name = 'blockstore.apps.api'
label = 'blockstore_apps_api'
verbose_name = "Blockstore API"
31 changes: 31 additions & 0 deletions blockstore/apps/api/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Exceptions that may be raised by the Blockstore API
"""


class BlockstoreException(Exception):
pass


class NotFound(BlockstoreException):
pass


class CollectionNotFound(NotFound):
pass


class BundleNotFound(NotFound):
pass


class DraftNotFound(NotFound):
pass


class BundleFileNotFound(NotFound):
pass


class BundleStorageError(BlockstoreException):
pass
Loading