collections_items_create_item¶
Upload a file, create a link or a folder
Functions
- async pydelfini.delfini_core.api.items.collections_items_create_item.asyncio(collection_id, version_id, *, client, body)[source]¶
Upload a file, create a link or a folder
Create a new item (a file, link, folder, or dataview) given its specification.
Two request body formats are supported:
application/json is typically used for links, folders, and very small files/dataviews. The item content (for files and dataviews) can be specified as a string in the request body, under the content.data field.
multipart/form-data is used for larger files. The item content should be provided in the form content field, and the item name will be taken as the content field’s filename attribute.
If provided, the folderId attribute should either be a string of an existing item ID that references a folder in the collection, or else the string "ROOT", denoting the top level of the collection.
For files and dataviews, the storage.url field should reference the URL of an existing datastore defined in the system (as listed by the /datastores API call). It can be assumed that the datastore delfini+datastore://default will always exist, but users may choose to store their data in an alternate datastore.
For links, the storage.url field should reference an external resource available through a standard URL scheme such as https:// or s3://, or another Delfini resource available through the URL scheme delfini://hostname/collection-id/version-id/item-id.
If the checksum of a file, link, or dataview is known by the client at the time of upload, it can be provided in either the storage.checksum field (supporting all item types) or the content.checksum field (supporting just files and dataviews).
If the user desires the item to be parseable as a table, the parser field should be set, with the name of the parser provided as well as optional parser options. Otherwise, the parser field can remain unset.
If the user knows or wishes to define the column schema of the item, a list of column definitions can be provided in the columns field. This should be omitted if the item will not be parsed as a table.
- Parameters:
collection_id (str)
version_id (str)
body – Creation of a new item
client (AuthenticatedClient)
- Raises:
errors.UnexpectedStatus – If the server returns a status code greater than or equal to 300.
httpx.TimeoutException – If the request takes longer than Client.timeout.
- Returns:
Union[Item]
- Return type:
- async pydelfini.delfini_core.api.items.collections_items_create_item.asyncio_detailed(collection_id, version_id, *, client, body)[source]¶
Upload a file, create a link or a folder
Create a new item (a file, link, folder, or dataview) given its specification.
Two request body formats are supported:
application/json is typically used for links, folders, and very small files/dataviews. The item content (for files and dataviews) can be specified as a string in the request body, under the content.data field.
multipart/form-data is used for larger files. The item content should be provided in the form content field, and the item name will be taken as the content field’s filename attribute.
If provided, the folderId attribute should either be a string of an existing item ID that references a folder in the collection, or else the string "ROOT", denoting the top level of the collection.
For files and dataviews, the storage.url field should reference the URL of an existing datastore defined in the system (as listed by the /datastores API call). It can be assumed that the datastore delfini+datastore://default will always exist, but users may choose to store their data in an alternate datastore.
For links, the storage.url field should reference an external resource available through a standard URL scheme such as https:// or s3://, or another Delfini resource available through the URL scheme delfini://hostname/collection-id/version-id/item-id.
If the checksum of a file, link, or dataview is known by the client at the time of upload, it can be provided in either the storage.checksum field (supporting all item types) or the content.checksum field (supporting just files and dataviews).
If the user desires the item to be parseable as a table, the parser field should be set, with the name of the parser provided as well as optional parser options. Otherwise, the parser field can remain unset.
If the user knows or wishes to define the column schema of the item, a list of column definitions can be provided in the columns field. This should be omitted if the item will not be parsed as a table.
- Parameters:
collection_id (str)
version_id (str)
body – Creation of a new item
client (AuthenticatedClient)
- Raises:
errors.UnexpectedStatus – If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException – If the request takes longer than Client.timeout.
- Returns:
Response[Union[Item, ServerError]]
- Return type:
- pydelfini.delfini_core.api.items.collections_items_create_item.sync(collection_id, version_id, *, client, body)[source]¶
Upload a file, create a link or a folder
Create a new item (a file, link, folder, or dataview) given its specification.
Two request body formats are supported:
application/json is typically used for links, folders, and very small files/dataviews. The item content (for files and dataviews) can be specified as a string in the request body, under the content.data field.
multipart/form-data is used for larger files. The item content should be provided in the form content field, and the item name will be taken as the content field’s filename attribute.
If provided, the folderId attribute should either be a string of an existing item ID that references a folder in the collection, or else the string "ROOT", denoting the top level of the collection.
For files and dataviews, the storage.url field should reference the URL of an existing datastore defined in the system (as listed by the /datastores API call). It can be assumed that the datastore delfini+datastore://default will always exist, but users may choose to store their data in an alternate datastore.
For links, the storage.url field should reference an external resource available through a standard URL scheme such as https:// or s3://, or another Delfini resource available through the URL scheme delfini://hostname/collection-id/version-id/item-id.
If the checksum of a file, link, or dataview is known by the client at the time of upload, it can be provided in either the storage.checksum field (supporting all item types) or the content.checksum field (supporting just files and dataviews).
If the user desires the item to be parseable as a table, the parser field should be set, with the name of the parser provided as well as optional parser options. Otherwise, the parser field can remain unset.
If the user knows or wishes to define the column schema of the item, a list of column definitions can be provided in the columns field. This should be omitted if the item will not be parsed as a table.
- Parameters:
collection_id (str)
version_id (str)
body – Creation of a new item
client (AuthenticatedClient)
- Raises:
errors.UnexpectedStatus – If the server returns a status code greater than or equal to 300.
httpx.TimeoutException – If the request takes longer than Client.timeout.
- Returns:
Union[Item]
- Return type:
- pydelfini.delfini_core.api.items.collections_items_create_item.sync_detailed(collection_id, version_id, *, client, body)[source]¶
Upload a file, create a link or a folder
Create a new item (a file, link, folder, or dataview) given its specification.
Two request body formats are supported:
application/json is typically used for links, folders, and very small files/dataviews. The item content (for files and dataviews) can be specified as a string in the request body, under the content.data field.
multipart/form-data is used for larger files. The item content should be provided in the form content field, and the item name will be taken as the content field’s filename attribute.
If provided, the folderId attribute should either be a string of an existing item ID that references a folder in the collection, or else the string "ROOT", denoting the top level of the collection.
For files and dataviews, the storage.url field should reference the URL of an existing datastore defined in the system (as listed by the /datastores API call). It can be assumed that the datastore delfini+datastore://default will always exist, but users may choose to store their data in an alternate datastore.
For links, the storage.url field should reference an external resource available through a standard URL scheme such as https:// or s3://, or another Delfini resource available through the URL scheme delfini://hostname/collection-id/version-id/item-id.
If the checksum of a file, link, or dataview is known by the client at the time of upload, it can be provided in either the storage.checksum field (supporting all item types) or the content.checksum field (supporting just files and dataviews).
If the user desires the item to be parseable as a table, the parser field should be set, with the name of the parser provided as well as optional parser options. Otherwise, the parser field can remain unset.
If the user knows or wishes to define the column schema of the item, a list of column definitions can be provided in the columns field. This should be omitted if the item will not be parsed as a table.
- Parameters:
collection_id (str)
version_id (str)
body – Creation of a new item
client (AuthenticatedClient)
- Raises:
errors.UnexpectedStatus – If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException – If the request takes longer than Client.timeout.
- Returns:
Response[Union[Item, ServerError]]
- Return type: