sams_client.schemas.sets
– Sets¶
-
SET_SCHEMA
= {'description': {'type': 'string'}, 'destination_config': {'allow_unknown': True, 'schema': {}, 'type': 'dict'}, 'destination_name': {'required': True, 'type': 'string'}, 'firstcreated': {'type': 'datetime'}, 'maximum_asset_size': {'mapping': {'type': 'long'}, 'type': 'integer'}, 'name': {'empty': False, 'nullable': False, 'required': True, 'type': 'string', 'unique': True}, 'original_creator': {'type': 'string'}, 'state': {'allowed': ('draft', 'usable', 'disabled'), 'default': 'draft', 'nullable': False, 'type': 'string'}, 'version_creator': {'type': 'string'}, 'versioncreated': {'type': 'datetime'}}¶ - Set Schema =
_id
bson.objectid.ObjectIdGlobally unique id, generated automatically by the system.
state
SET_STATE (sams_client.schemas.sets.SET_STATES
)The state of the Set. One of
draft
,usable
, ordisabled
.name
stringUnique name for the Set
description
stringA short description on what this set is designated for
destination_name
stringThe name of a registered StorageDestination (
sams.storage.destinations
)destination_config
dictA dictionary containing the configuration options for the specific destination used
maximum_asset_size
longThe maximum size of an Asset that can be uploaded to this Set (optional)
original_creator
stringA field to store the id of the user who created the set
version_creator
stringA field to store the id of the user who updated the set
firstcreated
stringA field to store time, when set is created
versioncreated
stringA field to store time, when set is updated
-
SET_STATES
: sams_client.schemas.sets.SetStates = SetStates(DRAFT='draft', USABLE='usable', DISABLED='disabled')¶ The state of a Set defines the available actions on it. A Set can be in any one of the following states:
DRAFT: allows the administrator to configure the Set with the correct
destination_name
anddestination_config
.destination_name
can be changeddestination_config
can be changedThe Set can be deleted
Assets cannot be uploaded to it
Assets cannot be downloaded from it
USABLE: Once the administrator has completed configuring the Set, they will change the
state
tousable
. This meansproducers
can now upload Assets to the Set.destination_name
cannot be changeddestination_config
cannot be changedThe Set cannot be deleted
The
state
can only be changed todisabled
Assets can be uploaded to it
Assets can be downloaded from it
DISABLED: The administrator is able to change a Set to be in disabled, so
producers
are unable to add new Assets to it.destination_name
cannot be changeddestination_config
cannot be changedThe Set cannot be deleted
The
state
can only be changed tousable
Assets cannot be uploaded to it
Assets can be downloaded from it
Note
The attributes
destination_name
anddestination_config
are read-only when thestate
isusable
ordisabled
. This is because the system would have to move Assets to the new destination, which would be better suited to a migrate endpoint.