connect.content
connect.content
Content resources.
Classes
Name | Description |
---|---|
Content | Content resource. |
ContentItem | |
ContentItemOAuth | |
ContentItemOwner |
Content
connect.content.Content(self, params, *, owner_guid=None)
Content resource.
Parameters
Name | Type | Description | Default |
---|---|---|---|
config |
Config |
Configuration object. | required |
session |
Session |
Requests session object. | required |
owner_guid |
str | Content item owner identifier. Filters results to those owned by a specific user (the default is None, which implies not filtering results on owner identifier). | None |
Attributes
Name | Description |
---|---|
owner_guid |
Methods
Name | Description |
---|---|
count | Count the number of content items. |
create | Create a content item. |
find | Find content matching the specified conditions. |
find_by | Find the first content record matching the specified attributes. There is no implied ordering so if order matters, you should find it yourself. |
find_one | Find first content result matching the specified conditions. |
get | Get a content item. |
count
connect.content.Content.count()
Count the number of content items.
Returns
Type | Description |
---|---|
int |
create
connect.content.Content.create(**attributes)
Create a content item.
Returns
Type | Description |
---|---|
ContentItem |
find
connect.content.Content.find(include=None, **conditions)
Find content matching the specified conditions.
Returns
Type | Description |
---|---|
List[ContentItem] |
find_by
connect.content.Content.find_by(**attributes)
Find the first content record matching the specified attributes. There is no implied ordering so if order matters, you should find it yourself.
Returns
Type | Description |
---|---|
Optional[ContentItem] |
Example
find_by(name=“example-content-name”)
find_one
connect.content.Content.find_one(**conditions)
Find first content result matching the specified conditions.
Returns
Type | Description |
---|---|
Optional[ContentItem] |
get
connect.content.Content.get(guid)
Get a content item.
Parameters
Name | Type | Description | Default |
---|---|---|---|
guid |
str | required |
Returns
Type | Description |
---|---|
ContentItem |
ContentItem
connect.content.ContentItem(self, /, params, **kwargs)
Attributes
Name | Description |
---|---|
bundles | |
environment_variables | |
is_interactive | |
is_rendered | |
oauth | |
owner | |
permissions |
Methods
Name | Description |
---|---|
delete | Delete the content item. |
deploy | Deploy the content. |
render | Render the content. |
restart | Mark for restart. |
update | Update the content. |
delete
connect.content.ContentItem.delete()
Delete the content item.
deploy
connect.content.ContentItem.deploy()
Deploy the content.
Spawns an asynchronous task, which activates the latest bundle.
Returns
Type | Description |
---|---|
tasks.Task | The task for the deployment. |
Examples
>>> task = content.deploy()
>>> task.wait_for()
None
render
connect.content.ContentItem.render()
Render the content.
Submit a render request to the server for the content. After submission, the server executes an asynchronous process to render the content. This is useful when content is dependent on external information, such as a dataset.
See Also
restart
Examples
>>> render()
restart
connect.content.ContentItem.restart()
Mark for restart.
Sends a restart request to the server for the content. Once submitted, the server performs an asynchronous process to restart the content. This is particularly useful when the content relies on external information loaded into application memory, such as datasets. Additionally, restarting can help clear memory leaks or reduce excessive memory usage that might build up over time.
See Also
render
Examples
>>> restart()
update
connect.content.ContentItem.update(**attributes)
Update the content.
ContentItemOAuth
connect.content.ContentItemOAuth(self, params, content_guid)
Attributes
Name | Description |
---|---|
associations | |
content_guid |
ContentItemOwner
connect.content.ContentItemOwner(self, /, params, **kwargs)