-
Notifications
You must be signed in to change notification settings - Fork 108
APIs to support metadata object creation and querying #2049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2b89f4a
d3f1a4b
e0d5cd1
4bd78a4
4c16e71
a32ad0b
cc49270
c164f18
f360de1
9ea5268
0f0c58a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,12 @@ | |
from pbench.common.exceptions import BadConfig, ConfigFileNotSpecified | ||
from pbench.server.api.resources.upload_api import Upload, HostInfo | ||
from pbench.server.api.resources.graphql_api import GraphQL | ||
from pbench.server.api.resources.metadata_api import ( | ||
CreateMetadata, | ||
GetMetadata, | ||
QueryMetadata, | ||
PublishMetadata, | ||
) | ||
from pbench.common.logger import get_pbench_logger | ||
from pbench.server.api.resources.query_apis.elasticsearch_api import Elasticsearch | ||
from pbench.server.api.resources.query_apis.query_controllers import QueryControllers | ||
|
@@ -84,6 +90,27 @@ def register_endpoints(api, app, config): | |
resource_class_args=(logger, token_auth), | ||
) | ||
|
||
api.add_resource( | ||
CreateMetadata, | ||
f"{base_uri}/metadata", | ||
resource_class_args=(config, logger, token_auth), | ||
) | ||
api.add_resource( | ||
GetMetadata, | ||
f"{base_uri}/metadata/<string:key>", | ||
resource_class_args=(config, logger, token_auth), | ||
) | ||
api.add_resource( | ||
QueryMetadata, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wondering what's the difference between "GetMetadata" and "QueryMetadata" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Having two classes somewhat obscures the relationship, but if you look at the URI registration in |
||
f"{base_uri}/metadata/<int:id>", | ||
resource_class_args=(config, logger), | ||
) | ||
api.add_resource( | ||
PublishMetadata, | ||
f"{base_uri}/metadata/<int:id>/publish", | ||
resource_class_args=(config, logger), | ||
) | ||
|
||
|
||
def get_server_config(): | ||
cfg_name = os.environ.get("_PBENCH_SERVER_CONFIG") | ||
|
Uh oh!
There was an error while loading. Please reload this page.