Skip to content

Commit

Permalink
chore: add missing GQL annotations (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyujin-cho committed Apr 4, 2024
1 parent dbb3c19 commit 4a3b6d1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/ai/backend/manager/api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type Queries {
): [Group]
image(reference: String!, architecture: String = "x86_64"): Image
images(is_installed: Boolean, is_operation: Boolean): [Image]

"""Added since 24.03.0"""
customized_images: [Image]
user(domain_name: String, email: String): User
user_from_uuid(domain_name: String, user_id: ID): User
Expand Down Expand Up @@ -168,7 +170,7 @@ type ComputeContainer implements Item {
"""Deprecated since 24.03.0; use image_object.name"""
image: String

"""Added at 24.03.0"""
"""Added since 24.03.0"""
image_object: ImageNode
architecture: String
registry: String
Expand Down Expand Up @@ -991,6 +993,8 @@ type Mutations {
preload_image(references: [String]!, target_agents: [String]!): PreloadImage
unload_image(references: [String]!, target_agents: [String]!): UnloadImage
modify_image(architecture: String = "x86_64", props: ModifyImageInput!, target: String!): ModifyImage

"""Added since 24.03.0"""
forget_image_by_id(image_id: String!): ForgetImageById
forget_image(architecture: String = "x86_64", reference: String!): ForgetImage
alias_image(alias: String!, architecture: String = "x86_64", target: String!): AliasImage
Expand Down Expand Up @@ -1101,6 +1105,8 @@ input GroupInput {
allowed_vfolder_hosts: JSONString = "{}"
integration_id: String = ""
resource_policy: String = "default"

"""Added since 24.03.0"""
container_registry: JSONString = "{}"
}

Expand All @@ -1121,6 +1127,8 @@ input ModifyGroupInput {
allowed_vfolder_hosts: JSONString
integration_id: String
resource_policy: String

"""Added since 24.03.0"""
container_registry: JSONString = "{}"
}

Expand Down Expand Up @@ -1303,6 +1311,7 @@ input ResourceLimitInput {
max: String
}

"""Added since 24.03.0."""
type ForgetImageById {
ok: Boolean
msg: String
Expand Down
4 changes: 2 additions & 2 deletions src/ai/backend/manager/models/gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Mutations(graphene.ObjectType):
preload_image = PreloadImage.Field()
unload_image = UnloadImage.Field()
modify_image = ModifyImage.Field()
forget_image_by_id = ForgetImageById.Field()
forget_image_by_id = ForgetImageById.Field(description="Added since 24.03.0")
forget_image = ForgetImage.Field()
alias_image = AliasImage.Field()
dealias_image = DealiasImage.Field()
Expand Down Expand Up @@ -356,7 +356,7 @@ class Queries(graphene.ObjectType):
is_operation=graphene.Boolean(),
)

customized_images = graphene.List(Image)
customized_images = graphene.List(Image, description="Added since 24.03.0")

user = graphene.Field(
User,
Expand Down
8 changes: 6 additions & 2 deletions src/ai/backend/manager/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ class GroupInput(graphene.InputObjectType):
allowed_vfolder_hosts = graphene.JSONString(required=False, default_value={})
integration_id = graphene.String(required=False, default_value="")
resource_policy = graphene.String(required=False, default_value="default")
container_registry = graphene.JSONString(required=False, default_value={})
container_registry = graphene.JSONString(
required=False, default_value={}, description="Added since 24.03.0"
)


class ModifyGroupInput(graphene.InputObjectType):
Expand All @@ -451,7 +453,9 @@ class ModifyGroupInput(graphene.InputObjectType):
allowed_vfolder_hosts = graphene.JSONString(required=False)
integration_id = graphene.String(required=False)
resource_policy = graphene.String(required=False)
container_registry = graphene.JSONString(required=False, default_value={})
container_registry = graphene.JSONString(
required=False, default_value={}, description="Added since 24.03.0"
)


class CreateGroup(graphene.Mutation):
Expand Down
2 changes: 2 additions & 0 deletions src/ai/backend/manager/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,8 @@ async def _rescan_task(reporter: ProgressReporter) -> None:


class ForgetImageById(graphene.Mutation):
"""Added since 24.03.0."""

allowed_roles = (
UserRole.SUPERADMIN,
UserRole.ADMIN,
Expand Down
2 changes: 1 addition & 1 deletion src/ai/backend/manager/models/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class Meta:

# image
image = graphene.String(description="Deprecated since 24.03.0; use image_object.name")
image_object = graphene.Field(ImageNode, description="Added at 24.03.0")
image_object = graphene.Field(ImageNode, description="Added since 24.03.0")
architecture = graphene.String()
registry = graphene.String()

Expand Down

0 comments on commit 4a3b6d1

Please sign in to comment.