-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/api/src/backend/serializers/ApplicationTaskSerializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
|
||
|
||
class ApplicationTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["image"] = model.image | ||
|
||
return task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from backend.serializers.CredentialsSerializer import CredentialsSerializer | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class ContextSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
context = {} | ||
context["branch"] = model | ||
context["credentials"] = CredentialsSerializer.serialize(model.credentials) | ||
context["recipe_file_path"] = model.recipe_file_path | ||
context["sub_path"] = model.sub_path | ||
context["tag"] = model.tag | ||
context["type"] = model.type | ||
context["url"] = model.url | ||
context["visibility"] = model.visibility | ||
context["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
return context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class CredentialsSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
|
||
credential = {} | ||
|
||
credential["sk_id"] = model.sk_id | ||
credential["owner"] = model.owner | ||
credential["created_at"] = model.created_at | ||
credential["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
|
||
return credential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from backend.serializers.CredentialsSerializer import CredentialsSerializer | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class DestinationSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
destination = {} | ||
destination["tag"] = model.tag, | ||
destination["type"] = model.type, | ||
destination["url"] = model.url, | ||
destination["filename"] = model.filename, | ||
destination["credentials"] = CredentialsSerializer.serialize(model.credentials) | ||
destination["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
return destination |
15 changes: 15 additions & 0 deletions
15
src/api/src/backend/serializers/ImageBuildTaskSerializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
from backend.serializers.ContextSerializer import ContextSerializer | ||
from backend.serializers.DestinationSerializer import DestinationSerializer | ||
|
||
|
||
class ImageBuildTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["builder"] = model.builder | ||
task["context"] = ContextSerializer.serialize(model.context) | ||
task["destination"] = DestinationSerializer(model.destination) | ||
|
||
return task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
from backend.serializers.CredentialsSerializer import CredentialsSerializer | ||
|
||
|
||
class RequestTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["auth"] = CredentialsSerializer.serialize(model.auth) | ||
task["data"] = model.data | ||
task["headers"] = model.headers | ||
task["http_method"] = model.http_method | ||
task["protocol"] = model.protocol | ||
task["query_params"] = model.query_params | ||
task["url"] = model.url | ||
|
||
return task |
13 changes: 13 additions & 0 deletions
13
src/api/src/backend/serializers/TapisActorTaskSerializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
|
||
|
||
class TapisActorTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["tapis_actor_id"] = model.tapis_job_def | ||
task["poll"] = model.poll | ||
task["tapis_actor_message"] = model.tapis_actor_message | ||
|
||
return task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
|
||
|
||
class TapisJobTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["tapis_job_def"] = model.tapis_job_def | ||
task["poll"] = model.poll | ||
|
||
return task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
|
||
|
||
class TemplateTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
# Returning only the base task because the only property relavent to | ||
# the template task (the `uses` property) is handled there. | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
return task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters