templates
« Previous section Next section »
UCloud Developer Guide / Orchestration of Resources / Storage / Metadata / Metadata Templates
Metadata Templates
Metadata templates define the schema for metadata documents.
Rationale
📝 NOTE: This API follows the standard Resources API. We recommend that you have already read and understood the concepts described here.
UCloud supports arbitrary of files. This feature is useful for general data management. It allows users to tag documents at a glance and search through them.
This feature consists of two parts:
Metadata templates (you are here): Templates specify the schema. You can think of this as a way of defining how your documents should look. We use them to generate user interfaces and visual representations of your documents.
Metadata documents (next section): Documents fill out the values of a template. When you create a document you must attach it to a file also.
At a technical level, we implement metadata templates using JSON schema. This gives you a fair amount of flexibility to control the format of documents. Of course, not everything is machine-checkable. To mitigate this, templates can require that changes go through an approval process. Only administrators of a workspace can approve such changes.
Table of Contents
Example: The Sensitivity Template
Frequency of use | Common |
---|---|
Actors |
|
Remote Procedure Calls
browse
browse
Browses the catalog of available resources
Request | Response | Error |
---|---|---|
browseTemplates
browseTemplates
Request | Response | Error |
---|---|---|
retrieve
retrieve
Retrieve a single resource
Request | Response | Error |
---|---|---|
retrieveLatest
retrieveLatest
Request | Response | Error |
---|---|---|
retrieveProducts
retrieveProducts
Retrieve product support for all accessible providers
Request | Response | Error |
---|---|---|
This endpoint will determine all providers that which the authenticated user has access to, in the current workspace. A user has access to a product, and thus a provider, if the product is either free or if the user has been granted credits to use the product.
See also:
retrieveTemplate
retrieveTemplate
Request | Response | Error |
---|---|---|
create
create
Creates one or more resources
Request | Response | Error |
---|---|---|
createTemplate
createTemplate
Request | Response | Error |
---|---|---|
deprecate
deprecate
Request | Response | Error |
---|---|---|
init
init
Request (potential) initialization of resources
Request | Response | Error |
---|---|---|
This request is sent by the client, if the client believes that initialization of resources might be needed. NOTE: This request might be sent even if initialization has already taken place. UCloud/Core does not check if initialization has already taken place, it simply validates the request.
updateAcl
updateAcl
Updates the ACL attached to a resource
Request | Response | Error |
---|---|---|
Data Models
FileMetadataTemplateAndVersion
FileMetadataTemplateAndVersion
FileMetadataTemplateNamespace
FileMetadataTemplateNamespace
A Resource
is the core data model used to synchronize tasks between UCloud and Provider.
For more information go here.
FileMetadataTemplateNamespace.Spec
FileMetadataTemplateNamespace.Spec
FileMetadataTemplateNamespace.Status
FileMetadataTemplateNamespace.Status
Describes the current state of the Resource
The contents of this field depends almost entirely on the specific Resource
that this field is managing. Typically, this will contain information such as:
A state value. For example, a compute
Job
might beRUNNING
Key metrics about the resource.
Related resources. For example, certain
Resource
s are bound to anotherResource
in a mutually exclusive way, this should be listed in thestatus
section.
FileMetadataTemplateNamespace.Update
FileMetadataTemplateNamespace.Update
Describes an update to the Resource
Updates can optionally be fetched for a Resource
. The updates describe how the Resource
changes state over time. The current state of a Resource
can typically be read from its status
field. Thus, it is typically not needed to use the full update history if you only wish to know the current state of a Resource
.
An update will typically contain information similar to the status
field, for example:
A state value. For example, a compute
Job
might beRUNNING
.Change in key metrics.
Bindings to related
Resource
s.
FileMetadataTemplateNamespaceFlags
FileMetadataTemplateNamespaceFlags
FileMetadataTemplateSupport
FileMetadataTemplateSupport
FileMetadataTemplatesBrowseTemplatesRequest
FileMetadataTemplatesBrowseTemplatesRequest
The base type for requesting paginated content.
Paginated content can be requested with one of the following consistency
guarantees, this greatly changes the semantics of the call:
Consistency | Description |
---|---|
| Consistency is preferred but not required. An inconsistent snapshot might be returned. |
| Consistency is required. A request will fail if consistency is no longer guaranteed. |
The consistency
refers to if collecting all the results via the pagination API are consistent. We consider the results to be consistent if it contains a complete view at some point in time. In practice this means that the results must contain all the items, in the correct order and without duplicates.
If you use the PREFER
consistency then you may receive in-complete results that might appear out-of-order and can contain duplicate items. UCloud will still attempt to serve a snapshot which appears mostly consistent. This is helpful for user-interfaces which do not strictly depend on consistency but would still prefer something which is mostly consistent.
The results might become inconsistent if the client either takes too long, or a service instance goes down while fetching the results. UCloud attempts to keep each next
token alive for at least one minute before invalidating it. This does not mean that a client must collect all results within a minute but rather that they must fetch the next page within a minute of the last page. If this is not feasible and consistency is not required then PREFER
should be used.
📝 NOTE: Services are allowed to ignore extra criteria of the request if the next
token is supplied. This is needed in order to provide a consistent view of the results. Clients should provide the same criterion as they paginate through the results.
Last updated