API Reference
Provider api/v1/providers views.
Providers are created and updated by applying manifests, with smarter apply, so these
views only read them:
GET providers/: the active Providers that the user may read.GET providers/<name>/: an active Provider that the user may read.GET providers/<name>/models/: the active models of that Provider.GET providers/<name>/models/<model_name>/: one active model of that Provider.
A Provider or model that does not exist, is inactive, or belongs to another account answers 404, so that the Providers of other accounts are not disclosed.
The responses are built from the models of smarter.apps.provider.contract.models, which the
Smarter api’s OpenAPI document publishes.
- class smarter.apps.provider.api.v1.views.provider.ProviderApiViewSet(*args, **kwargs)[source]
Bases:
ProviderViewBaseAn active Provider that the user may read.
- serializer_class
alias of
ProviderSerializer
- class smarter.apps.provider.api.v1.views.provider.ProviderModelApiViewSet(*args, **kwargs)[source]
Bases:
ProviderViewBaseAn active model of an active Provider that the user may read.
- serializer_class
alias of
ProviderModelSerializer
- class smarter.apps.provider.api.v1.views.provider.ProviderModelsApiViewSet(*args, **kwargs)[source]
Bases:
ProviderViewBaseThe active models of an active Provider that the user may read.
- serializer_class
alias of
ProviderModelSerializer
- class smarter.apps.provider.api.v1.views.provider.ProviderViewBase(*args, **kwargs)[source]
Bases:
SmarterAuthenticatedAPIViewBase class for views of one Provider, identified by its
name.get_provider()returns the Provider only if it is active and the user may read it. Otherwise it raisesHttp404. Provider names are unique per account, so when the user may read several Providers of that name, their own account’s wins.
- class smarter.apps.provider.api.v1.views.provider.ProvidersApiViewSet(*args, **kwargs)[source]
Bases:
ContractListMixin,SmarterAuthenticatedListAPIViewThe active Providers that the user may read.
- contract_model
alias of
ProviderApiProvider
- get_queryset(*args, **kwargs)[source]
Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
- Return type:
- serializer_class
alias of
ProviderSerializer