本文整理汇总了Python中misc.Logger.logger.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: create_method
def create_method(self, restid, resourceid, method, authorizationtype, apikeyreq=False, further_opts=None):
"""
This function creates a method object
:param method: the method that is requested
:type method: basestring
:param restid: the id of the rest api object
:type restid: basestring
:param resourceid: id of a single resource object
:type resourceid: basestring
:param authorizationtype:
:type authorizationtype: basestring
:param apikeyreq: should apikey be required
:type apikeyreq: bool
:param further_opts: This opt passes in json_data fur not mandatory options
:type further_opts: dict
:return: the created method object
"""
if self.dryrun:
logger.info("Dryrun requested no changes will be done")
return None
if isinstance(apikeyreq, bool) is False:
logger.debug("apikey is not boolean, converting")
apikeyreq = Misc.str2bool(apikeyreq)
opts = {'restApiId': restid, 'resourceId': resourceid, 'httpMethod': method,
'authorizationType': authorizationtype, 'apiKeyRequired': apikeyreq}
if 'requestParameters' in further_opts:
opts['requestParameters'] = further_opts['requestParameters']
if 'requestModels' in further_opts:
opts['requestModels'] = further_opts['requestModels']
logger.debug("The opts sent to create method %s" % opts)
resp = self.apigateway_client.put_method(**opts)
super(Apigateway, self).query_information(query=resp)
return resp
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:33,代码来源:apigateway.py
示例2: create_method_response
def create_method_response(self, restid, resourceid, method, statuscode, further_ops):
"""
This function creates a method response
:param method: the method that is requested
:type method: basestring
:param restid: the id of the rest api object
:type restid: basestring
:param resourceid: id of a single resource object
:type resourceid: basestring
:param statuscode: the status code
:type statuscode: basestring
:param further_opts: This opt passes in json_data fur not mandatory options
:type further_opts: dict
:return: the created method response object
"""
if self.dryrun:
logger.info("Dryrun requested no changes will be done")
return None
opts = {'restApiId': restid, 'resourceId': resourceid, 'httpMethod': method, 'statusCode': statuscode}
if 'responseParameters' in further_ops:
opts['responseParameters'] = further_ops['responseParameters']
if 'responseModels' in further_ops:
opts['responseModels'] = further_ops['responseModels']
logger.debug("The opts sent to create method response %s" % opts)
resp = self.apigateway_client.put_method_response(**opts)
super(Apigateway, self).query_information(query=resp)
return resp
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:27,代码来源:apigateway.py
示例3: create_integration
def create_integration(self, restid, resourceid, method, integration_type, further_opts=None):
"""
This function creates an integration object
:param method: the method that is requested
:type method: basestring
:param restid: the id of the rest api object
:type restid: basestring
:param resourceid: id of a single resource object
:type resourceid: basestring
:param integration_type: an enum of the integration type
:type integration_type: basestring
:param further_opts: This opt passes in json_data fur not mandatory options
:type further_opts: dict
:return: object of the created integration
"""
if self.dryrun:
logger.info("Dryrun requested no changes will be done")
return None
opts = {'restApiId': restid, 'resourceId': resourceid, 'httpMethod': method, 'type': integration_type,
'integrationHttpMethod': method}
# There is aws cli bug and integrationHttpMethod also needs to be added. may change later
# opts = {'restApiId': restid, 'resourceId': resourceid, 'httpMethod': method, 'type': integration_type}
for element in ['integrationHttpMethod', 'uri', 'credentials', 'requestParameters', 'requestTemplates',
'cacheNamespace', 'cacheNamespace']:
if element in further_opts:
opts[element] = further_opts[element]
logger.debug("The opts for integration object creation: %s" % opts)
resp = self.apigateway_client.put_integration(**opts)
super(Apigateway, self).query_information(query=resp)
return resp
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:30,代码来源:apigateway.py
示例4: report_elb
def report_elb(self):
'''
This function is a wrapper for parsing arguments and printing for elb attribute reports
Tested
:return:
'''
logger.info("Started report generation command")
a = awsrequests(session=self.account_information['session'])
parser = argparse.ArgumentParser(description='report generation about elbs', usage='''kerrigan.py elb report_elb [<args>]]
''' + self.global_options, formatter_class=argparse.ArgumentDefaultsHelpFormatter, prog="kerrigan")
parser.add_argument('--columns', action='store', default=a.service_supported_columns(service="elb"),
help="Which columns to display")
parser.add_argument('--filters', action='store', default=None,
help="The filters that should be used, example: key1:value1,key2:value2")
args = parser.parse_args(sys.argv[3:])
columns = Misc.parse_service_columns(columns=args.columns, service="elb")
if args.filters:
filters = Misc.format_boto3_filter(filters=args.filters)
else:
filters = None
result = a.information_elbs(columns=columns, filters=filters)
for res in result:
if self.account_information['logger_arguments']['table']:
res['AvailabilityZones'] = Misc.list_to_multiline_string(list=res['AvailabilityZones'])
res['SecurityGroups'] = Misc.list_to_multiline_string(list=res['SecurityGroups'])
res['Instances'] = Misc.list_to_multiline_string(list=res['Instances'])
else:
res['AvailabilityZones'] = Misc.join_list_to_string(list=res['AvailabilityZones'])
res['SecurityGroups'] = Misc.join_list_to_string(list=res['SecurityGroups'])
res['Instances'] = Misc.join_list_to_string(list=res['Instances'])
logger.output(data=result, csvvar=self.account_information['logger_arguments']['csv'],
tablevar=self.account_information['logger_arguments']['table'])
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:32,代码来源:elb.py
示例5: delete_deployment
def delete_deployment(self, restid, deploymentid):
if self.dryrun:
logger.info("Dryrun requested no changes will be done")
return None
ret = self.apigateway_client.delete_deployment(restApiId=restid, deploymentId=deploymentid)
super(Apigateway, self).query_information(query=ret)
return ret
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:7,代码来源:apigateway.py
示例6: create_integration_response
def create_integration_response(self, restid, resourceid, method, statuscode, further_opts=None):
"""
This function creates an integration response object
:param method: the method that is requested
:type method: basestring
:param restid: the id of the rest api object
:type restid: basestring
:param resourceid: id of a single resource object
:type resourceid: basestring
:param statuscode: thestatus code to attach integration response
:type statuscode: basestring
:param further_opts: This opt passes in json_data fur not mandatory options
:type further_opts: dict
:return:
"""
if self.dryrun:
logger.info("Dryrun requested no changes will be done")
return None
opts = {'restApiId': restid, 'resourceId': resourceid, 'httpMethod': method, 'statusCode': statuscode}
for element in ['selectionPattern', 'responseParameters', 'responseTemplates']:
if element in further_opts:
if further_opts[element] == "None":
opts[element] = None
else:
opts[element] = further_opts[element]
logger.debug("The opts sent to create integration response %s" % opts)
resp = self.apigateway_client.put_integration_response(**opts)
super(Apigateway, self).query_information(query=resp)
return resp
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:29,代码来源:apigateway.py
示例7: stack
def stack(self):
logger.info("Starting to gather information")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py upgrade stack [<args>]]
''' + self.global_options)
parser.add_argument('--stack', action='store', help="Which stack to upgrade",required=True)
parser.add_argument('--env', action='store', help="Which env to do tasks in",required=True)
args = parser.parse_args(sys.argv[3:])
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:7,代码来源:upgrade.py
示例8: compare
def compare(self):
logger.info("Starting to gather information")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py s3 compare [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Name of env")
args = parser.parse_args(sys.argv[3:])
c = awschecks()
c.compare_s3(env=args.env)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:s3.py
示例9: compare_certs
def compare_certs(self):
logger.info("Going to check env certs")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py iam compare_certs [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Envs to check")
args = parser.parse_args(sys.argv[3:])
a = awschecks()
a.compare_certs(env=args.env)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:iam.py
示例10: query_parameter_group
def query_parameter_group(self):
logger.info("Gather parameter group values")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py rds query_parameter_group [<args>]]
''' + self.global_options)
parser.add_argument('--name', action='store', help="Name of db-parameter group")
args = parser.parse_args(sys.argv[3:])
e = awsrds()
ret = e.get_parameter_group(name=args.name)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:rds.py
示例11: list_users
def list_users(self):
logger.info("Going to list users")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py iam list_users [<args>]]
''' + self.global_options)
args = parser.parse_args(sys.argv[3:])
a = awsrequests()
res = a.list_iam_users()
logger.output(data=res, csvvar=self.cli['csv'], tablevar=self.cli['table'])
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:iam.py
示例12: gw_watchdog
def gw_watchdog(self):
logger.info("Starting watchdog")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py route53 watchdog [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Environment to gather information about")
args = parser.parse_args(sys.argv[3:])
a = awsservice()
a.gw_watchdog(env=args.env)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:route53.py
示例13: delete_server_cert
def delete_server_cert(self):
logger.info("Going to delete cert")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py iam delete_server_cert [<args>]]
''' + self.global_options)
parser.add_argument('--cert_name', action='store', help="Name of certificate to delete")
args = parser.parse_args(sys.argv[3:])
a = awsrequests()
a.server_certificate_delete(cert_name=args.cert_name)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:iam.py
示例14: compare
def compare(self):
logger.info("Creating ELB")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py elb create [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Which env to check")
args = parser.parse_args(sys.argv[3:])
c = awschecks()
c.compare_elb(env=args.env)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:8,代码来源:elb.py
示例15: sync_instances
def sync_instances(self):
logger.info("Syncing Instances to ELB")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py elb sync_instances [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Which env to check")
parser.add_argument('--dryrun', action='store_true',default=False, help="No changes should be done")
args = parser.parse_args(sys.argv[3:])
c = awschecks()
c.sync_instances_to_elbs(env=args.env,dryrun=args.dryrun)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:9,代码来源:elb.py
示例16: validate_kerrigan_json
def validate_kerrigan_json(stack_data, env):
# do some tests
logger.debug(msg="Validating if stack can be deployed to env")
if 'envs' in stack_data and env in stack_data['envs']:
logger.info(msg="Stack can be deployed to environment %s" % (env,))
else:
logger.error(msg="Stack should not be deployed to Environment %s" % (env,))
exit(20)
return stack_data
开发者ID:s4mur4i,项目名称:char-libv2,代码行数:9,代码来源:Validator.py
示例17: compare_iam
def compare_iam(self):
logger.info("Going to check env iam certificates")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py iam compare_iam [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Envs to check")
parser.add_argument('--dryrun', action='store_true', default=False, help="No changes should be done")
args = parser.parse_args(sys.argv[3:])
a = awschecks()
a.compare_iam(env=args.env, dryrun=args.dryrun)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:9,代码来源:iam.py
示例18: list_buckets
def list_buckets(self):
logger.info("Starting to gather information")
a = awsrequests()
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py s3 list_buckets [<args>]]
''' + self.global_options)
parser.add_argument('--extended', action='store_true', default=False, help="Gather extended info about Buckets")
args = parser.parse_args(sys.argv[3:])
res = a.list_s3_buckets(extended=args.extended)
logger.output(data=res, csvvar=self.cli['csv'], tablevar=self.cli['table'])
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:9,代码来源:s3.py
示例19: compare
def compare(self):
logger.info("Starting comparing route53 entries")
parser = argparse.ArgumentParser(description='ec2 tool for devops', usage='''kerrigan.py route53 compare [<args>]]
''' + self.global_options)
parser.add_argument('--env', action='store', help="Environment to gather information about")
parser.add_argument('--dryrun', action='store_true',default=False, help="No changes should be done")
args = parser.parse_args(sys.argv[3:])
a = awschecks()
a.compare_route53(env=args.env,dryrun=args.dryrun)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:9,代码来源:route53.py
示例20: overflow
def overflow(self):
logger.info("Started stack provision command")
a = awsrequests(session=self.account_information['session'])
parser = argparse.ArgumentParser(description='stack provision', usage='''kerrigan.py stack overflow [<args>]]
''' + self.global_options, formatter_class=argparse.ArgumentDefaultsHelpFormatter, prog="kerrigan")
parser.add_argument('--json', action='store', required=True, help="Stack json to provision")
parser.add_argument('--env', action='store', required=True, help="Which env to deploy to")
parser.add_argument('--dryrun', action='store_true', default=False, help="No changes should be done")
args = parser.parse_args(sys.argv[3:])
a.deploy_stack_to_env(env=args.env, file=args.json, dryrun=args.dryrun)
开发者ID:s4mur4i,项目名称:kerrigan,代码行数:10,代码来源:stack.py
注:本文中的misc.Logger.logger.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论