-
Notifications
You must be signed in to change notification settings - Fork 32
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
21 changed files
with
991 additions
and
885 deletions.
There are no files selected for viewing
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
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,45 @@ | ||
from typing import ClassVar, Optional, Callable, Type | ||
|
||
from requests.models import Response | ||
|
||
from harvester_api.models.backups import RestoreSpec | ||
from .base import BaseManager | ||
|
||
|
||
class BackupManager(BaseManager): | ||
BACKUP_fmt: ClassVar[str] | ||
RESTORE_fmt: ClassVar[str] | ||
RestoreSpec: Type[RestoreSpec] | ||
|
||
def get( | ||
self, | ||
name: str = ..., | ||
namespace: str = ..., | ||
*, | ||
raw: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def create( | ||
self, | ||
name: str, | ||
restore_spec: Type[RestoreSpec], | ||
namespace: str = ..., | ||
*, | ||
raw: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def delete( | ||
self, | ||
name: str, | ||
namespace: str = ..., | ||
*, | ||
raw: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
restore: Callable |
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,31 @@ | ||
from __future__ import annotations | ||
from typing import Final, NoReturn, ClassVar, Type | ||
|
||
from .api import HarvesterAPI | ||
|
||
DEFAULT_NAMESPACE: Final[str] | ||
|
||
|
||
def merge_dict(src: dict, dest: dict) -> dict: | ||
""" | ||
""" | ||
|
||
|
||
class BaseManager: | ||
support_to: ClassVar[str] | ||
|
||
@classmethod | ||
def is_support(cls, target_version: str) -> bool: | ||
""" | ||
""" | ||
@classmethod | ||
def for_version(cls, version: str) -> Type[BaseManager]: | ||
""" | ||
""" | ||
def __init__(self, api: HarvesterAPI) -> NoReturn: | ||
""" | ||
""" | ||
@property | ||
def api(self) -> HarvesterAPI: | ||
""" | ||
""" |
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,110 @@ | ||
from typing import ClassVar, Optional | ||
from collections.abc import Mapping | ||
|
||
from requests.models import Response | ||
|
||
from .base import BaseManager | ||
|
||
|
||
class ClusterNetworkManager(BaseManager): | ||
PATH_fmt: ClassVar[str] | ||
CONFIG_fmt: ClassVar[str] | ||
|
||
def create_data( | ||
self, | ||
name: str, | ||
description: str = ..., | ||
labels: Optional[dict] = ..., | ||
annotations: Optional[dict] = ... | ||
) -> dict: | ||
""" | ||
""" | ||
def create_config_data( | ||
self, | ||
name: str, | ||
clusternetwork: str, | ||
*nics: str, | ||
bond_mode: Optional[str] = ..., | ||
hostname: Optional[str] = ..., | ||
miimon: Optional[int] = ..., | ||
mtu: Optional[int] = ... | ||
) -> dict: | ||
""" | ||
""" | ||
def get( | ||
self, | ||
name: str = ..., | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def create( | ||
self, | ||
name: str, | ||
description: str = ..., | ||
labels: Optional[dict] = ..., | ||
annotations: Optional[dict] = ..., | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def update( | ||
self, | ||
name: str, | ||
data: Mapping, | ||
*, | ||
raw: Optional[bool] = ..., | ||
as_json: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def delete( | ||
self, | ||
name: str, | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def get_config( | ||
self, | ||
name: str = ..., | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def create_config( | ||
self, | ||
name: str, | ||
clusternetwork: str, | ||
*nics: str, | ||
bond_mode: Optional[str] = ..., | ||
hostname: Optional[str] = ..., | ||
miimon: Optional[int] = ..., | ||
mtu: Optional[int] = ..., | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def update_config( | ||
self, | ||
name: str, | ||
data: Mapping, | ||
*, | ||
raw: Optional[bool] = ..., | ||
as_json: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def delete_config( | ||
self, | ||
name: str, | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" |
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,57 @@ | ||
from typing import ClassVar, Optional, NoReturn | ||
from collections.abc import Mapping | ||
|
||
from requests.models import Response | ||
|
||
from .base import BaseManager | ||
|
||
|
||
class HostManager(BaseManager): | ||
PATH_fmt: ClassVar[str] | ||
METRIC_fmt: ClassVar[str] | ||
|
||
def get( | ||
self, | ||
name: str = ..., | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def create(self, *args, **kwargs) -> NoReturn: | ||
""" | ||
""" | ||
def update( | ||
self, | ||
name: str, | ||
data: Mapping, | ||
*, | ||
raw: Optional[bool] = ..., | ||
as_json: Optional[bool] = ..., | ||
**kwargs | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def delete( | ||
self, | ||
name: str, | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def get_metrics( | ||
self, | ||
name: str = ..., | ||
*, | ||
raw: Optional[bool] = ... | ||
) -> dict | Response: | ||
""" | ||
""" | ||
def maintenance_mode( | ||
self, | ||
name: str, | ||
enable: Optional[bool] = ... | ||
) -> dict: | ||
""" | ||
""" |
Oops, something went wrong.