Source code for jdcloud_sdk.services.nc.apis.GetLogsRequest

# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


[docs]class GetLogsRequest(JDCloudRequest): """ 查询单个容器日志 """ def __init__(self, parameters, header=None, version="v1"): super(GetLogsRequest, self).__init__( '/regions/{regionId}/containers/{containerId}:getLogs', 'GET', header, version) self.parameters = parameters
[docs]class GetLogsParameters(object): def __init__(self, regionId, containerId, ): """ :param regionId: Region ID :param containerId: Container ID """ self.regionId = regionId self.containerId = containerId self.tailLines = None self.sinceSeconds = None self.limitBytes = None
[docs] def setTailLines(self, tailLines): """ :param tailLines: (Optional) 返回日志文件中倒数 tailLines 行,如不指定,默认从容器启动时或 sinceSeconds 指定的时间读取。 """ self.tailLines = tailLines
[docs] def setSinceSeconds(self, sinceSeconds): """ :param sinceSeconds: (Optional) 返回相对于当前时间之前sinceSeconds之内的日志。 """ self.sinceSeconds = sinceSeconds
[docs] def setLimitBytes(self, limitBytes): """ :param limitBytes: (Optional) 限制返回的日志文件内容字节数,取值范围 [1-4]KB,最大 4KB. """ self.limitBytes = limitBytes