fix circular import
parent
9abc11f187
commit
f750056ad8
|
@ -4,15 +4,21 @@ import strawberry
|
||||||
from selfprivacy_api.graphql.common_types.dns import DnsRecord
|
from selfprivacy_api.graphql.common_types.dns import DnsRecord
|
||||||
|
|
||||||
from selfprivacy_api.graphql.common_types.storage_usage import (
|
from selfprivacy_api.graphql.common_types.storage_usage import (
|
||||||
ServiceStorageUsage,
|
StorageUsageInterface,
|
||||||
StorageVolume,
|
StorageVolume,
|
||||||
)
|
)
|
||||||
from selfprivacy_api.graphql.queries.services import get_volume_by_id
|
|
||||||
from selfprivacy_api.services import get_service_by_id, get_services_by_location
|
from selfprivacy_api.services import get_service_by_id, get_services_by_location
|
||||||
from selfprivacy_api.services import Service as ServiceInterface
|
from selfprivacy_api.services import Service as ServiceInterface
|
||||||
from selfprivacy_api.utils.block_devices import BlockDevices
|
from selfprivacy_api.utils.block_devices import BlockDevices
|
||||||
|
|
||||||
|
|
||||||
|
@strawberry.type
|
||||||
|
class ServiceStorageUsage(StorageUsageInterface):
|
||||||
|
"""Storage usage for a service"""
|
||||||
|
|
||||||
|
service: typing.Optional["Service"]
|
||||||
|
|
||||||
|
|
||||||
@strawberry.enum
|
@strawberry.enum
|
||||||
class ServiceStatusEnum(Enum):
|
class ServiceStatusEnum(Enum):
|
||||||
RUNNING = "RUNNING"
|
RUNNING = "RUNNING"
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import typing
|
import typing
|
||||||
import strawberry
|
import strawberry
|
||||||
|
|
||||||
from selfprivacy_api.graphql.common_types.service import Service
|
|
||||||
|
|
||||||
|
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
class StorageVolume:
|
class StorageVolume:
|
||||||
|
@ -24,10 +22,3 @@ class StorageUsageInterface:
|
||||||
used_space: str
|
used_space: str
|
||||||
volume: typing.Optional[StorageVolume]
|
volume: typing.Optional[StorageVolume]
|
||||||
title: str
|
title: str
|
||||||
|
|
||||||
|
|
||||||
@strawberry.type
|
|
||||||
class ServiceStorageUsage(StorageUsageInterface):
|
|
||||||
"""Storage usage for a service"""
|
|
||||||
|
|
||||||
service: typing.Optional["Service"]
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
import typing
|
import typing
|
||||||
import strawberry
|
import strawberry
|
||||||
from selfprivacy_api.graphql.common_types.service import (
|
from selfprivacy_api.graphql.common_types.service import (
|
||||||
|
ServiceStorageUsage,
|
||||||
service_to_graphql_service,
|
service_to_graphql_service,
|
||||||
get_volume_by_id,
|
get_volume_by_id,
|
||||||
)
|
)
|
||||||
from selfprivacy_api.graphql.common_types.storage_usage import (
|
from selfprivacy_api.graphql.common_types.storage_usage import (
|
||||||
ServiceStorageUsage,
|
|
||||||
StorageVolume,
|
StorageVolume,
|
||||||
)
|
)
|
||||||
from selfprivacy_api.services import get_services_by_location
|
from selfprivacy_api.services import get_services_by_location
|
||||||
|
|
Loading…
Reference in New Issue