api.views

RESTful view classes for presenting Deis API objects.

class api.views.AdminPermsViewSet(**kwargs)[source]

RESTful views for sharing admin permissions with other users.

create(request, **kwargs)[source]
destroy(request, **kwargs)[source]
get_queryset(**kwargs)[source]
model

alias of User

permission_classes = [<class 'api.permissions.IsAdmin'>]
serializer_class

alias of AdminUserSerializer

class api.views.AppPermsViewSet(**kwargs)[source]

RESTful views for sharing apps with collaborators.

create(request, **kwargs)[source]
destroy(request, **kwargs)[source]
get_queryset()[source]
list(request, **kwargs)[source]
model

alias of App

perm = 'use_app'
class api.views.AppResourceViewSet(**kwargs)[source]

A viewset for objects which are attached to an application.

create(request, **kwargs)[source]
get_app()[source]
get_object(**kwargs)[source]
get_queryset(**kwargs)[source]
class api.views.AppViewSet(**kwargs)[source]

A viewset for interacting with App objects.

get_queryset(*args, **kwargs)[source]
list(request, *args, **kwargs)[source]

HACK: Instead of filtering by the queryset, we limit the queryset to list only the apps which are owned by the user as well as any apps they have been given permission to interact with.

logs(request, **kwargs)[source]
model

alias of App

post_save(app)[source]
run(request, **kwargs)[source]
scale(request, **kwargs)[source]
serializer_class

alias of AppSerializer

class api.views.BaseDeisViewSet(**kwargs)[source]

A generic ViewSet for objects related to Deis.

To use it, at minimum you’ll need to provide the serializer_class attribute and the model attribute shortcut.

create(request, *args, **kwargs)[source]
lookup_field = 'id'
permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'api.permissions.IsAppUser'>]
renderer_classes = [<class 'rest_framework.renderers.JSONRenderer'>]
class api.views.BaseHookViewSet(**kwargs)[source]
permission_classes = [<class 'api.permissions.HasBuilderAuth'>]
class api.views.BuildHookViewSet(**kwargs)[source]

API hook to create new Build

create(request, *args, **kwargs)[source]
model

alias of Build

post_save(build)[source]
serializer_class

alias of BuildSerializer

class api.views.BuildViewSet(**kwargs)[source]

A viewset for interacting with Build objects.

model

alias of Build

post_save(build)[source]
serializer_class

alias of BuildSerializer

class api.views.CertificateViewSet(**kwargs)[source]

A viewset for interacting with Domain objects.

get_object(**kwargs)[source]

Retrieve domain certificate by common name

model

alias of Certificate

serializer_class

alias of CertificateSerializer

class api.views.ConfigHookViewSet(**kwargs)[source]

API hook to grab latest Config

create(request, *args, **kwargs)[source]
model

alias of Config

serializer_class

alias of ConfigSerializer

class api.views.ConfigViewSet(**kwargs)[source]

A viewset for interacting with Config objects.

model

alias of Config

post_save(config)[source]
serializer_class

alias of ConfigSerializer

class api.views.ContainerViewSet(**kwargs)[source]

A viewset for interacting with Container objects.

get_object(**kwargs)[source]
get_queryset(**kwargs)[source]
model

alias of Container

restart(*args, **kwargs)[source]
serializer_class

alias of ContainerSerializer

class api.views.DomainViewSet(**kwargs)[source]

A viewset for interacting with Domain objects.

get_object(**kwargs)[source]
model

alias of Domain

serializer_class

alias of DomainSerializer

class api.views.KeyViewSet(**kwargs)[source]

A viewset for interacting with Key objects.

model

alias of Key

permission_classes = [<class 'rest_framework.permissions.IsAuthenticated'>, <class 'api.permissions.IsOwner'>]
serializer_class

alias of KeySerializer

class api.views.PushHookViewSet(**kwargs)[source]

API hook to create new Push

create(request, *args, **kwargs)[source]
model

alias of Push

serializer_class

alias of PushSerializer

class api.views.ReleasableViewSet(**kwargs)[source]

A viewset for application resources which affect the release cycle.

When a resource is created, a new release is created for the application and it returns some success headers regarding the new release.

To use it, at minimum you’ll need to provide a release attribute tied to your class before calling post_save().

get_object()[source]

Retrieve the object based on the latest release’s value

get_success_headers(data, **kwargs)[source]
class api.views.ReleaseViewSet(**kwargs)[source]

A viewset for interacting with Release objects.

get_object(**kwargs)[source]

Get release by version always

model

alias of Release

rollback(request, **kwargs)[source]

Create a new release as a copy of the state of the compiled slug and config vars of a previous release.

serializer_class

alias of ReleaseSerializer

class api.views.TokenManagementViewSet(**kwargs)[source]
get_object()[source]
get_queryset()[source]
permission_classes = [<class 'api.permissions.CanRegenerateToken'>]
regenerate(request, **kwargs)[source]
serializer_class

alias of UserSerializer

class api.views.UserManagementViewSet(**kwargs)[source]
get_object()[source]
get_queryset()[source]
passwd(request, **kwargs)[source]
serializer_class

alias of UserSerializer

class api.views.UserRegistrationViewSet(**kwargs)[source]

ViewSet to handle registering new users. The logic is in the serializer.

authentication_classes = [<class 'api.authentication.AnonymousOrAuthenticatedAuthentication'>]
permission_classes = [<class 'api.permissions.HasRegistrationAuth'>]
serializer_class

alias of UserSerializer

class api.views.UserView(**kwargs)[source]

A Viewset for interacting with User objects.

get_queryset()[source]
model

alias of User

permission_classes = [<class 'api.permissions.IsAdmin'>]
serializer_class

alias of UserSerializer