air_sdk.endpoints.marketplace_demos

View as Markdown

Stub file for marketplace demos endpoint type hints.

Classes

NameDescription
MarketplaceDemoMarketplace demo model representing a marketplace demo.
MarketplaceDemoEndpointAPIAPI client for marketplace demo endpoints.

Module Contents

class air_sdk.endpoints.marketplace_demos.MarketplaceDemo

Bases: air_sdk.air_model.AirModel

Marketplace demo model representing a marketplace demo.

id: str

Unique identifier for the marketplace demo

name: str

Human-readable name of the marketplace demo

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

Timestamp when the marketplace demo was created

Timestamp when the marketplace demo was last modified

creator: str

The creator of the marketplace demo

documentation: str | None

The documentation of the marketplace demo

tags: list[str]

The tags of the marketplace demo

like_count: int

How many unique users have liked the marketplace demo

liked_by_client: bool

Whether the current user has liked the marketplace demo

published: bool

Whether the marketplace demo is published

expected_resource_usage: SimRequiredResources

Estimated resources required to provision the demo

description: str | None

The description of the demo

repo: str | None

The repository of the marketplace demo

icon: str | None

The icon of the marketplace demo

get_model_api() -> type[MarketplaceDemoEndpointAPI]
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 = ...

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

Publish the marketplace demo.

Example:

>>> marketplace_demo.publish()
unpublish(**kwargs: Any) -> None

Unpublish the marketplace demo.

Example:

>>> marketplace_demo.unpublish()
provision(**kwargs: Any) -> Simulation

Provision a simulation from this marketplace demo.

Returns:

The newly created simulation instance.

Example:

>>> simulation = marketplace_demo.provision()
>>> print(simulation.name)
class air_sdk.endpoints.marketplace_demos.MarketplaceDemoEndpointAPI

Bases: air_sdk.air_model.BaseEndpointAPI[air_sdk.endpoints.marketplace_demos.MarketplaceDemo]

API client for marketplace demo endpoints.

API_PATH: str
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 = ...

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: 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 = ...

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: 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 | PrimaryKey,
**kwargs: Any
) -> None

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 | PrimaryKey,
**kwargs: Any
) -> None

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 | PrimaryKey,
**kwargs: Any

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.

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)