File tree Expand file tree Collapse file tree 11 files changed +37
-21
lines changed
Expand file tree Collapse file tree 11 files changed +37
-21
lines changed Original file line number Diff line number Diff line change 1414# limitations under the License.
1515
1616from .service .client_set import ClientSet
17- from .service .client_v1 import TaskExecuteFailedError , OBShellHandleError
17+ from .service .client_v1 import TaskExecuteFailedError , OBShellHandleError , IllegalOperatorError
1818from .service .client_v1 import IllegalOperatorError , ClientV1
1919
2020__all__ = ('ClientSet' , 'TaskExecuteFailedError' ,
Original file line number Diff line number Diff line change 1212# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313# See the License for the specific language governing permissions and
1414# limitations under the License.
15+
16+ from .tenant import ZoneParam ,ModifyReplicaParam
Original file line number Diff line number Diff line change 1+ # coding: utf-8
2+ # Copyright (c) 2024 OceanBase.
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ def model_str (cls ):
17+ def __convert_value (value ):
18+ if isinstance (value , list ):
19+ return [__convert_value (item ) for item in value ]
20+ elif isinstance (value , dict ):
21+ return {f"{ key } " : __convert_value (value ) for key , value in value .items ()}
22+ else :
23+ return str (value )
24+ members = ", " .join (
25+ f"\" { k } \" :\" { __convert_value (v )} \" " for k , v in cls .__dict__ .items ())
26+ return '{' + members .replace ("'" , "\" " ) + '}'
Original file line number Diff line number Diff line change 1616from typing import List
1717from enum import Enum
1818
19+ from .format import model_str
1920from obshell .model .version import Version
2021from obshell .auth .base import AuthVersion
2122
2223
23- def model_str (cls ):
24- def __convert_value (value ):
25- if isinstance (value , list ):
26- return [__convert_value (item ) for item in value ]
27- elif isinstance (value , dict ):
28- return {f"{ key } " : __convert_value (value ) for key , value in value .items ()}
29- else :
30- return str (value )
31- members = ", " .join (
32- f"\" { k } \" :\" { __convert_value (v )} \" " for k , v in cls .__dict__ .items ())
33- return '{' + members .replace ("'" , "\" " ) + '}'
34-
35-
3624class AgentInfo :
3725
3826 def __init__ (self ,
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .info import model_str
16+ from .format import model_str
1717
1818
1919class UpgradePkgInfo :
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .info import model_str
16+ from .format import model_str
1717
1818
1919class RecyclebinTenantInfo :
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .info import model_str
16+ from .format import model_str
1717from .unit import UnitConfig
1818
1919
Original file line number Diff line number Diff line change 1515
1616import json
1717from enum import Enum
18- from .info import model_str
18+ from .format import model_str
1919
2020
2121class State (Enum ):
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .info import model_str
16+ from .format import model_str
1717from .resource_pool import ResourcePoolWithUnit
1818
1919
Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- from .info import model_str
16+ from .format import model_str
1717
1818
1919class UnitConfig :
You can’t perform that action at this time.
0 commit comments