air_sdk.endpoints.marketplace_demos#

Stub file for marketplace demos endpoint type hints.

Classes#

MarketplaceDemo

Marketplace demo model representing a marketplace demo.

MarketplaceDemoEndpointAPI

API client for marketplace demo endpoints.

Module Contents#

class air_sdk.endpoints.marketplace_demos.MarketplaceDemo[source]#

Bases: air_sdk.air_model.AirModel

Marketplace demo model representing a marketplace demo.

id#

Unique identifier for the marketplace demo

name#

Human-readable name of the marketplace demo

created#

Timestamp when the marketplace demo was created

modified#

Timestamp when the marketplace demo was last modified

creator#

The creator of the marketplace demo

description#

The description of the demo

documentation#

The documentation of the marketplace demo

repo#

The repository of the marketplace demo

tags#

The tags of the marketplace demo

like_count#

How many unique users have liked the marketplace demo

liked_by_client#

Whether the current user has liked the marketplace demo

published#

Whether the marketplace demo is published

icon#

The icon of the marketplace demo

demo#

Demo simulation to be used as a base for cloned simulations.

id: str#
name: str#
demo: air_sdk.endpoints.simulations.Simulation#
created: datetime.datetime#
modified: datetime.datetime#
creator: str#
documentation: str | None#
tags: list[str]#
like_count: int#
liked_by_client: bool#
published: bool#
description: str | None#
repo: str | None#
icon: str | None#
classmethod get_model_api() type[MarketplaceDemoEndpointAPI][source]#

Returns the respective AirModelAPI type for this model.

property model_api: MarketplaceDemoEndpointAPI#
update(
*,
name: str | dataclasses._MISSING_TYPE = ...,
description: str | None | dataclasses._MISSING_TYPE = ...,
documentation: str | None | dataclasses._MISSING_TYPE = ...,
repo: str | None | dataclasses._MISSING_TYPE = ...,
tags: list[str] | dataclasses._MISSING_TYPE = ...,
icon: str | None | dataclasses._MISSING_TYPE = ...,
) MarketplaceDemo#

Update the marketplace demo’s properties.

Parameters:
  • name – New name for the marketplace demo

  • description – Description of the marketplace demo

  • documentation – Documentation of the marketplace demo

  • repo – Repository of the marketplace demo

  • tags – Tags of the marketplace demo

  • icon – Icon of the marketplace demo

Returns:

The updated MarketplaceDemo instance

Example

>>> marketplace_demo.update(name='New Name', description='New Desc')
>>> print(marketplace_demo.name)
publish(**kwargs: Any) None[source]#

Publish the marketplace demo.

Example

>>> marketplace_demo.publish()
unpublish(**kwargs: Any) None[source]#

Unpublish the marketplace demo.

Example

>>> marketplace_demo.unpublish()
provision(**kwargs: Any) air_sdk.endpoints.simulations.Simulation[source]#

Provision a simulation from this marketplace demo.

Returns:

The newly created simulation instance.

Return type:

Simulation

Example

>>> simulation = marketplace_demo.provision()
>>> print(simulation.name)
class air_sdk.endpoints.marketplace_demos.MarketplaceDemoEndpointAPI(
api: air_sdk.AirApi,
default_filters: dict[str, Any] | None = None,
)[source]#

Bases: air_sdk.air_model.BaseEndpointAPI[MarketplaceDemo]

API client for marketplace demo endpoints.

API_PATH: str#
model: type[MarketplaceDemo]#
create(
*,
name: str,
simulation: str,
description: str | None | dataclasses._MISSING_TYPE = ...,
documentation: str | None | dataclasses._MISSING_TYPE = ...,
repo: str | None | dataclasses._MISSING_TYPE = ...,
tags: list[str] | dataclasses._MISSING_TYPE = ...,
icon: str | None | dataclasses._MISSING_TYPE = ...,
checkpoint: str | None | dataclasses._MISSING_TYPE = ...,
) MarketplaceDemo#

Create a new marketplace demo.

Parameters:
  • name – Name for the new marketplace demo

  • simulation – Simulation to be used to provision the marketplace demo

  • description – Description of the marketplace demo

  • documentation – Documentation of the marketplace demo

  • repo – Repository of the marketplace demo

  • tags – Tags of the marketplace demo

  • icon – Icon of the marketplace demo

  • checkpoint – A COMPLETE checkpoint to clone from. Provided checkpoint must belong to the simulation. If not specified, latest COMPLETE checkpoint will be used.

Returns:

The created MarketplaceDemo instance

Example

>>> marketplace_demo = api.marketplace_demos.create(
...     name='My Marketplace Demo',
...     simulation='sim-id',
...     description='My Demo Description',
...     documentation='My Demo Documentation',
...     repo='My Demo Repo',
...     tags=['networking', 'sonic'],
... )
delete(pk: air_sdk.air_model.PrimaryKey) None#

Delete a marketplace demo.

Parameters:

pk – The marketplace demo ID (string or UUID)

Example

>>> api.marketplace_demos.delete('marketplace-demo-id')
list(
*,
creator: str | dataclasses._MISSING_TYPE = ...,
published: bool | dataclasses._MISSING_TYPE = ...,
tags: list[str] | dataclasses._MISSING_TYPE = ...,
search: str | dataclasses._MISSING_TYPE = ...,
ordering: str | dataclasses._MISSING_TYPE = ...,
liked_by_client: bool | dataclasses._MISSING_TYPE = ...,
limit: int | dataclasses._MISSING_TYPE = ...,
offset: int | dataclasses._MISSING_TYPE = ...,
) Iterator[MarketplaceDemo]#

List all marketplace demos.

Optional parameters:

creator: Filter by creator email published: Filter by published status tags: Filter by tags search: Search term to filter demos ordering: Order the response by the specified field liked_by_client: Filter by liked by client status limit: Number of results to return per page offset: The initial index from which to return the results

Returns:

Iterator of MarketplaceDemo instances

Example

>>> # List all demos
>>> for demo in api.marketplace_demos.list():
...     print(demo.name)
>>> # List with filters
>>> results = list(
...     api.marketplace_demos.list(
...         creator='test@example.com',
...         published=True,
...         tags=['networking'],
...     )
... )
get(pk: air_sdk.air_model.PrimaryKey) MarketplaceDemo#

Get a specific marketplace demo by ID.

Parameters:

pk – The marketplace demo ID (string or UUID)

Returns:

The MarketplaceDemo instance

Example

>>> marketplace_demo = api.marketplace_demos.get('marketplace-demo-id')
>>> print(marketplace_demo.name)
publish(
*,
marketplace_demo: MarketplaceDemo | air_sdk.air_model.PrimaryKey,
**kwargs: Any,
) None[source]#

Publish a marketplace demo.

Parameters:

marketplace_demo – The marketplace demo to publish (object or ID)

Returns:

None

Example

>>> # Using demo object
>>> api.marketplace_demos.publish(marketplace_demo=marketplace_demo)
>>> # Or using ID
>>> api.marketplace_demos.publish(marketplace_demo='marketplace-demo-id')
unpublish(
*,
marketplace_demo: MarketplaceDemo | air_sdk.air_model.PrimaryKey,
**kwargs: Any,
) None[source]#

Unpublish a marketplace demo.

Parameters:

marketplace_demo – The marketplace demo to unpublish (object or ID)

Returns:

None

Example

>>> api.marketplace_demos.unpublish(marketplace_demo=marketplace_demo)
provision(
*,
marketplace_demo: MarketplaceDemo | air_sdk.air_model.PrimaryKey,
**kwargs: Any,
) air_sdk.endpoints.simulations.Simulation[source]#

Provision a simulation from a marketplace demo.

Creates a new simulation by cloning the demo simulation.

Parameters:

marketplace_demo – The marketplace demo to provision (object or ID)

Returns:

The newly created simulation instance.

Return type:

Simulation

Example

>>> # Using demo object
>>> marketplace_demo = api.marketplace_demos.get('marketplace-demo-id')
>>> simulation = marketplace_demo.provision()
>>> print(simulation.id)
>>> # Or using API directly with ID
>>> demo_id = 'marketplace-demo-id'
>>> simulation = api.marketplace_demos.provision(marketplace_demo=demo_id)
>>> print(simulation.name)