当前位置: 首页>>代码示例>>Python>>正文


Python AwsHook.expand_role方法代码示例

本文整理汇总了Python中airflow.contrib.hooks.aws_hook.AwsHook.expand_role方法的典型用法代码示例。如果您正苦于以下问题:Python AwsHook.expand_role方法的具体用法?Python AwsHook.expand_role怎么用?Python AwsHook.expand_role使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在airflow.contrib.hooks.aws_hook.AwsHook的用法示例。


在下文中一共展示了AwsHook.expand_role方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: expand_role

# 需要导入模块: from airflow.contrib.hooks.aws_hook import AwsHook [as 别名]
# 或者: from airflow.contrib.hooks.aws_hook.AwsHook import expand_role [as 别名]
 def expand_role(self):
     if 'Model' not in self.config:
         return
     hook = AwsHook(self.aws_conn_id)
     config = self.config['Model']
     if 'ExecutionRoleArn' in config:
         config['ExecutionRoleArn'] = hook.expand_role(config['ExecutionRoleArn'])
开发者ID:MiguelPeralvo,项目名称:incubator-airflow,代码行数:9,代码来源:sagemaker_endpoint_operator.py

示例2: test_expand_role

# 需要导入模块: from airflow.contrib.hooks.aws_hook import AwsHook [as 别名]
# 或者: from airflow.contrib.hooks.aws_hook.AwsHook import expand_role [as 别名]
 def test_expand_role(self):
     conn = boto3.client('iam', region_name='us-east-1')
     conn.create_role(RoleName='test-role', AssumeRolePolicyDocument='some policy')
     hook = AwsHook()
     arn = hook.expand_role('test-role')
     expect_arn = conn.get_role(RoleName='test-role').get('Role').get('Arn')
     self.assertEqual(arn, expect_arn)
开发者ID:MiguelPeralvo,项目名称:incubator-airflow,代码行数:9,代码来源:test_aws_hook.py

示例3: expand_role

# 需要导入模块: from airflow.contrib.hooks.aws_hook import AwsHook [as 别名]
# 或者: from airflow.contrib.hooks.aws_hook.AwsHook import expand_role [as 别名]
 def expand_role(self):
     if 'TrainingJobDefinition' in self.config:
         config = self.config['TrainingJobDefinition']
         if 'RoleArn' in config:
             hook = AwsHook(self.aws_conn_id)
             config['RoleArn'] = hook.expand_role(config['RoleArn'])
开发者ID:apache,项目名称:incubator-airflow,代码行数:8,代码来源:sagemaker_tuning_operator.py

示例4: expand_role

# 需要导入模块: from airflow.contrib.hooks.aws_hook import AwsHook [as 别名]
# 或者: from airflow.contrib.hooks.aws_hook.AwsHook import expand_role [as 别名]
 def expand_role(self):
     if 'ExecutionRoleArn' in self.config:
         hook = AwsHook(self.aws_conn_id)
         self.config['ExecutionRoleArn'] = hook.expand_role(self.config['ExecutionRoleArn'])
开发者ID:Fokko,项目名称:incubator-airflow,代码行数:6,代码来源:sagemaker_model_operator.py


注:本文中的airflow.contrib.hooks.aws_hook.AwsHook.expand_role方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。