嗨,我设计了一个函数来创建红移集群并获取其属性。 如何仅在群集状态可用时自动执行函数writeinconfig文件触发器
def prettyRedshiftProps(props):
pd.set_option('display.max_colwidth', -1)
keysToShow = ["ClusterIdentifier", "NodeType", "ClusterStatus", "MasterUsername", "DBName",
"Endpoint", "NumberOfNodes", 'VpcId']
x = [(k, v) for k,v in props.items() if k in keysToShow]
return pd.DataFrame(data=x, columns=["Key", "Value"])
myClusterProps = redshift.describe_clusters(ClusterIdentifier=DWH_CLUSTER_IDENTIFIER)
['Clusters'][0]
prettyRedshiftProps(myClusterProps)
函数,用于在另一个配置文件中写入clusterprop的值
# trigger the function when cluster status become available
def writeinconfig :
{
''' write values of clusterprops in config file'''
}
目前没有回答
相关问题 更多 >
编程相关推荐