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

published: bool

Whether the marketplace demo is published

publicly_published: bool
demo_simulation_state: DEMO_SIMULATION_STATE

The state of the simulation instance associated with this demo which acts as the template for all provisioned simulations from this demo.

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

publisher: str

The name of the company or organization the marketplace demo is published under (e.g. NVIDIA, Google). A publisher must be set before the demo can be published.

icon: str | None

The icon of the marketplace demo

publish_access_record_id: str | None
featured: bool

Whether the marketplace demo is featured. Featured demos appear before non-featured demos in the default ordering.

order: int | None

The ordering value of the marketplace demo. Demos with a lower order value appear before demos with a higher order value. May be null.

provision_count: int

Number of times a clone has been provisioned from this marketplace demo (counted when the provision request creates the clone; not decremented if that clone later fails to boot).

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 = ...,
publisher: str | 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
  • publisher – The company or organization the demo is published under (e.g. NVIDIA, Google). Required before the demo can be published.
  • 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(
*,
prefer_public: bool = ...,
allowed_orgs: list[PrimaryKey] = ...,
justification: str = ...,
publish_images: bool = ...,
**kwargs: Any
) -> None

Publish the marketplace demo.

A publisher must be set on the demo before it can be published.

Parameters:

  • prefer_public – Whether to publish as public (true, default) or restricted (false). When false, supply the authoritative allowed_orgs.
  • allowed_orgs – Authoritative allow-list: orgs that may use the demo when prefer_public is false. The demo owning org is always included; [] is valid. Privileged endpoint only — not the gated request-publish string hint.
  • justification – Optional text explaining who/why to share with.
  • publish_images – When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

Example:

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

Immediately unpublish the marketplace demo (privileged).

This privileged action takes no request body. To submit a gated unpublish request for review instead, use request_unpublish.

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)
request_publish(
*,
justification: str,
prefer_public: bool = ...,
allowed_orgs_request_text: str = ...,
publish_images: bool = ...,
publisher: str = ...,
tags: list[str] = ...

Submit a request to publish this marketplace demo.

A publisher must be set on the demo — either previously or via this request — before the demo can be queued for publishing.

Parameters:

  • justification – Required explanation for the review request and notifications.
  • prefer_public – When true, the requester prefers a public publish. When false, the requester prefers a restricted-access publish; describe the desired allow list in allowed_orgs_request_text.
  • allowed_orgs_request_text – Optional free-text description of orgs that should have access if the outcome is restricted. Not the authoritative allow list.
  • publish_images – When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.
  • publisher – Optional publisher name to set on the demo when submitting the request (e.g. NVIDIA, Google). Omitting the field leaves the existing publisher unchanged.
  • tags – Optional tag names to assign to the demo when submitting the request (same rules as demo update). Omitting the field leaves the demo’s existing tags unchanged; an empty list clears them.

Returns:

the marketplace demo instance with updated publish_access_record_id

Example:

>>> marketplace_demo.request_publish(justification='Ready for community use')
request_unpublish(
*,
justification: str

Submit a request to unpublish this marketplace demo.

Parameters:

  • justification – Required explanation for the review request and notifications.

Returns:

the marketplace demo instance

Example:

>>> marketplace_demo.request_unpublish(justification='No longer maintained')
request_public(
*,
prefer_public: bool,
justification: str,
publish_images: bool = ...

Submit a request to change marketplace demo visibility to public or restricted.

Parameters:

  • prefer_public – When true, request catalog-wide visibility. When false, request restricted visibility.
  • justification – Required explanation for the review request and notifications.
  • publish_images – When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

Returns:

the marketplace demo instance

Example:

>>> marketplace_demo.request_public(
... prefer_public=True,
... justification='Open source',
... publish_images=True,
... )
request_allowlist_change(
*,
justification: str,
allowed_orgs_request_text: str,
publish_images: bool = ...

Submit a request to change the allowlist for this marketplace demo.

Parameters:

  • justification – Required explanation for the review request and notifications.
  • allowed_orgs_request_text – Required description of the allow-list change (e.g. org names or IDs).
  • publish_images – When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

Returns:

the marketplace demo instance

Example:

>>> marketplace_demo.request_allowlist_change(
... justification='Add partner orgs',
... allowed_orgs_request_text='org-a, org-b',
... )
cancel_publish_access_record(**kwargs: Any) -> MarketplaceDemo

Cancel the active publish access record for this marketplace demo.

Returns:

the marketplace demo instance

Example:

>>> marketplace_demo.cancel_publish_access_record()
manage(
*,
featured: bool = ...,
order: int | None = ...,
**kwargs: Any

Adjust how this marketplace demo is featured and ordered.

Privileged action (SRE/ADMIN). See manage.

Parameters:

  • featured – Whether the demo is featured. Featured demos appear before non-featured demos in the default ordering.
  • order – The ordering value of the demo. Demos with a lower order value appear before demos with a higher order value. Pass None to clear the demo’s order.

Returns:

the updated marketplace demo instance

Example:

>>> marketplace_demo.manage(featured=True, order=1)
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
API_PUBLISH_PATH: str
API_UNPUBLISH_PATH: str
API_PROVISION_PATH: str
API_REQUEST_PUBLISH_PATH: str
API_REQUEST_UNPUBLISH_PATH: str
API_REQUEST_PUBLIC_PATH: str
API_REQUEST_ALLOWLIST_CHANGE_PATH: str
API_CANCEL_PUBLISH_ACCESS_RECORD_PATH: str
API_MANAGE_PATH: str
API_TIGHTEN_ORDER_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 = ...,
publisher: str | 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
  • publisher – The company or organization the demo is published under (e.g. NVIDIA, Google). Required before the demo can be published.
  • 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(
*,
demo_simulation_state: DEMO_SIMULATION_STATE | dataclasses._MISSING_TYPE = ...,
creator: str | dataclasses._MISSING_TYPE = ...,
tags: list[str] | dataclasses._MISSING_TYPE = ...,
published: bool | dataclasses._MISSING_TYPE = ...,
publicly_published: bool | dataclasses._MISSING_TYPE = ...,
featured: bool | dataclasses._MISSING_TYPE = ...,
publisher: str | dataclasses._MISSING_TYPE = ...,
search: str | dataclasses._MISSING_TYPE = ...,
ordering: str | dataclasses._MISSING_TYPE = ...,
limit: int | dataclasses._MISSING_TYPE = ...,
offset: int | dataclasses._MISSING_TYPE = ...

List all marketplace demos.

Optional parameters: demo_simulation_state: Filter by the state of the template simulation creator: Filter by creator email tags: Filter by tags (matched case-insensitively) published: Filter by published status (true or false) publicly_published: Filter by publicly published status (true or false) featured: Filter by whether the demo is featured (true or false). Featured demos are listed before non-featured demos in the default ordering. publisher: Filter by the company or organization the demo is published under (e.g. NVIDIA). Matched case-insensitively. search: Search term to filter demos ordering: Order the response by the specified field 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,
prefer_public: bool = ...,
allowed_orgs: List[PrimaryKey] = ...,
justification: str = ...,
publish_images: bool = ...,
**kwargs: Any
) -> None

Publish a marketplace demo.

A publisher must be set on the demo before it can be published.

Parameters:

  • marketplace_demo – The marketplace demo to publish (object or ID)
  • prefer_public – Whether to publish as public (true, default) or restricted (false). When false, supply the authoritative allowed_orgs.
  • allowed_orgs – Authoritative allow-list: orgs that may use the demo when prefer_public is false. The demo owning org is always included; [] is valid. Privileged endpoint only — not the gated request-publish string hint.
  • justification – Optional text explaining who/why to share with.
  • publish_images – When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

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)
request_publish(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey,
justification: str,
prefer_public: bool = ...,
allowed_orgs_request_text: str = ...,
publish_images: bool = ...,
publisher: str = ...,
tags: List[str] = ...

Submit a request to publish a marketplace demo.

A publisher must be set on the demo — either previously or via this request — before the demo can be queued for publishing.

Args:

Required parameters: marketplace_demo: Marketplace demo to request publication for (MarketplaceDemo instance or marketplace demo ID) justification: Required explanation for the review request and notifications.

Optional parameters: prefer_public: When true, the requester prefers a public publish. When false, the requester prefers a restricted-access publish; describe the desired allow list in allowed_orgs_request_text. allowed_orgs_request_text: Optional free-text description of orgs that should have access if the outcome is restricted. Not the authoritative allow list. publish_images: When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience. publisher: Optional publisher name to set on the demo when submitting the request (e.g. NVIDIA, Google). Omitting the field leaves the existing publisher unchanged. tags: Optional tag names to assign to the demo when submitting the request (same rules as demo update). Omitting the field leaves the demo’s existing tags unchanged; an empty list clears them.

Returns:

MarketplaceDemo: the marketplace demo instance with updated publish_access_record_id

Example:

>>> api.marketplace_demos.request_publish(
... marketplace_demo=marketplace_demo,
... justification='Ready',
... )
request_unpublish(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey,
justification: str

Submit a request to unpublish a marketplace demo.

Args:

Required parameters: marketplace_demo: Marketplace demo to request unpublication for (MarketplaceDemo instance or marketplace demo ID) justification: Required explanation for the review request and notifications.

Returns:

MarketplaceDemo: the marketplace demo instance

Example:

>>> api.marketplace_demos.request_unpublish(
... marketplace_demo=marketplace_demo,
... justification='Deprecated',
... )
request_public(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey,
prefer_public: bool,
justification: str,
publish_images: bool = ...

Submit a request to change marketplace demo visibility to public or restricted.

Args:

Required parameters: marketplace_demo: Marketplace demo to update (MarketplaceDemo instance or marketplace demo ID) prefer_public: When true, request catalog-wide visibility. When false, request restricted visibility. justification: Required explanation for the review request and notifications.

Optional parameters: publish_images: When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

Returns:

MarketplaceDemo: the marketplace demo instance

Example:

>>> api.marketplace_demos.request_public(
... marketplace_demo=marketplace_demo,
... prefer_public=True,
... justification='Open source',
... )
request_allowlist_change(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey,
justification: str,
allowed_orgs_request_text: str,
publish_images: bool = ...

Submit a request to change the allowlist for a marketplace demo.

Args:

Required parameters: marketplace_demo: Marketplace demo to update (MarketplaceDemo instance or marketplace demo ID) justification: Required explanation for the review request and notifications. allowed_orgs_request_text: Required description of the allow-list change (e.g. org names or IDs).

Optional parameters: publish_images: When true, automatically publish org-owned images referenced by the demo so they reach the same audience as the demo. When false (default), the request is rejected with 400 if any referenced image needs to be published to reach the demo audience.

Returns:

MarketplaceDemo: the marketplace demo instance

Example:

>>> api.marketplace_demos.request_allowlist_change(
... marketplace_demo=marketplace_demo,
... justification='Add partner orgs',
... allowed_orgs_request_text='org-a, org-b',
... )
cancel_publish_access_record(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey

Cancel the active publish access record for a marketplace demo.

Args:

Required parameters: marketplace_demo: Marketplace demo to cancel the record for (MarketplaceDemo instance or marketplace demo ID)

Returns:

MarketplaceDemo: the marketplace demo instance

Example:

>>> api.marketplace_demos.cancel_publish_access_record(
... marketplace_demo=marketplace_demo,
... )
manage(
*,
marketplace_demo: MarketplaceDemo | PrimaryKey,
featured: bool = ...,
order: int | None = ...,
**kwargs: Any

Adjust how a marketplace demo is featured and ordered.

Privileged action (SRE/ADMIN). Featured demos appear before non-featured demos in the default ordering, and demos with a lower order value appear before demos with a higher order value.

Args:

Required parameters: marketplace_demo: Marketplace demo to manage (MarketplaceDemo instance or marketplace demo ID)

Optional parameters: featured: Whether the demo is featured. order: The ordering value of the demo. Pass None to clear the demo’s order.

Returns:

MarketplaceDemo: the updated marketplace demo instance

Example:

>>> api.marketplace_demos.manage(
... marketplace_demo=marketplace_demo,
... featured=True,
... order=1,
... )
tighten_order(**kwargs: Any) -> None

Re-number marketplace demo order values to be consecutive from 1.

Privileged action (SRE/ADMIN). Re-numbers the populated order values of marketplace demos so that they are consecutive starting at 1, preserving their relative ordering. For example, demos with order=[1, 5, 20] become [1, 2, 3]. Demos with order=None are left untouched.

Returns:

None

Example:

>>> api.marketplace_demos.tighten_order()