@@ -73,40 +73,6 @@ def decribe_container(self):
7373 except Exception as e :
7474 print (e )
7575
76- @expose (
77- arguments = [
78- (['--region-id' ], dict (help = """(string) Region ID """ , dest = 'regionId' , required = False )),
79- (['--pod-id' ], dict (help = """(string) Pod ID """ , dest = 'podId' , required = True )),
80- (['--container-name' ], dict (help = """(string) container name """ , dest = 'containerName' , required = True )),
81- (['--input-json' ], dict (help = '(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
82- (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
83- ],
84- formatter_class = RawTextHelpFormatter ,
85- help = ''' 查询单个容器日志; ''' ,
86- description = '''
87- 查询单个容器日志;
88-
89- 示例: jdc pod attach --pod-id xxx --container-name xxx
90- ''' ,
91- )
92- def attach (self ):
93- client_factory = ClientFactory ('pod' )
94- client = client_factory .get (self .app )
95- if client is None :
96- return
97-
98- try :
99- from jdcloud_sdk .services .pod .apis .AttachRequest import AttachRequest
100- params_dict = collect_user_args (self .app )
101- headers = collect_user_headers (self .app )
102- req = AttachRequest (params_dict , headers )
103- resp = client .send (req )
104- Printer .print_result (resp )
105- except ImportError :
106- print ('{"error":"This api is not supported, please use the newer version"}' )
107- except Exception as e :
108- print (e )
109-
11076 @expose (
11177 arguments = [
11278 (['--region-id' ], dict (help = """(string) Region ID """ , dest = 'regionId' , required = False )),
@@ -178,41 +144,6 @@ def exec_get_exit_code(self):
178144 except Exception as e :
179145 print (e )
180146
181- @expose (
182- arguments = [
183- (['--region-id' ], dict (help = """(string) Region ID """ , dest = 'regionId' , required = False )),
184- (['--pod-id' ], dict (help = """(string) Pod ID """ , dest = 'podId' , required = True )),
185- (['--container-name' ], dict (help = """(string) container name """ , dest = 'containerName' , required = True )),
186- (['--exec-id' ], dict (help = """(string) NA """ , dest = 'execId' , required = False )),
187- (['--input-json' ], dict (help = '(json) 以JSON字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
188- (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
189- ],
190- formatter_class = RawTextHelpFormatter ,
191- help = ''' 执行exec,此接口需要升级Http协议到WebSocket ''' ,
192- description = '''
193- 执行exec,此接口需要升级Http协议到WebSocket
194-
195- 示例: jdc pod exec-start --pod-id xxx --container-name xxx
196- ''' ,
197- )
198- def exec_start (self ):
199- client_factory = ClientFactory ('pod' )
200- client = client_factory .get (self .app )
201- if client is None :
202- return
203-
204- try :
205- from jdcloud_sdk .services .pod .apis .ExecStartRequest import ExecStartRequest
206- params_dict = collect_user_args (self .app )
207- headers = collect_user_headers (self .app )
208- req = ExecStartRequest (params_dict , headers )
209- resp = client .send (req )
210- Printer .print_result (resp )
211- except ImportError :
212- print ('{"error":"This api is not supported, please use the newer version"}' )
213- except Exception as e :
214- print (e )
215-
216147 @expose (
217148 arguments = [
218149 (['--region-id' ], dict (help = """(string) Region ID """ , dest = 'regionId' , required = False )),
@@ -853,4 +784,4 @@ def attach(self):
853784 )
854785 def generate_skeleton (self ):
855786 skeleton = Skeleton ('pod' , self .app .pargs .api )
856- skeleton .show ()
787+ skeleton .show ()
0 commit comments