Example #1
0
    def delete(self, *args, **kwargs):
        """ Delete a tenant request.

        Args:
            tenant_id: network name of a tenant

        Example URLs:

            PUT /api/v1/pending/52313ecb-9d00-4b7d-b873-b55d3d9ada26

        """

        try:

            if len(args) == 0:

                pendings = RUNTIME.load_pending_tenants()

                for pending in pendings:
                    RUNTIME.reject_tenant(pending.tenant_id)

            else:

                tenant_id = UUID(args[0])
                RUNTIME.reject_tenant(tenant_id)

        except ValueError as ex:
            self.send_error(400, message=ex)
        except KeyError as ex:
            self.send_error(404, message=ex)
        self.set_status(204, None)
    def delete(self, *args, **kwargs):
        """ Delete a tenant request.

        Args:
            tenant_id: network name of a tenant

        Example URLs:

            PUT /api/v1/pending/52313ecb-9d00-4b7d-b873-b55d3d9ada26

        """

        try:

            if len(args) == 0:

                pendings = RUNTIME.load_pending_tenants()

                for pending in pendings:
                    RUNTIME.reject_tenant(pending.tenant_id)

            else:

                tenant_id = UUID(args[0])
                RUNTIME.reject_tenant(tenant_id)

        except ValueError as ex:
            self.send_error(400, message=ex)
        except KeyError as ex:
            self.send_error(404, message=ex)
        self.set_status(204, None)