Exemplo n.º 1
0
def main():
    # Set to False if you do not have a valid certificate for your Turbot Host
    turbot_host_certificate_verification = True

    # Set to your Turbot Host URL
    turbot_host = turbotutils.get_turbot_host()

    # Get the access and secret key pairs
    (turbot_api_access_key,
     turbot_api_secret_key) = turbotutils.get_turbot_access_keys()

    # Get the turbot account numbers
    accounts = turbotutils.cluster.get_turbot_account_ids(
        turbot_api_access_key, turbot_api_secret_key,
        turbot_host_certificate_verification, turbot_host)

    for tid, id in accounts.items():
        print(tid + ',' + str(id).zfill(12))
Exemplo n.º 2
0
def turbot_main():
    # Set to False if you do not have a valid certificate for your Turbot Host
    turbot_host_certificate_verification = True

    # Set to your Turbot Host URL
    turbot_host = turbotutils.get_turbot_host()

    # Get the access and secret key pairs
    (turbot_api_access_key,
     turbot_api_secret_key) = turbotutils.get_turbot_access_keys()

    # Get the turbot account numbers
    accounts = turbotutils.get_turbot_account_ids(
        turbot_api_access_key, turbot_api_secret_key,
        turbot_host_certificate_verification, turbot_host)
    for account in accounts:
        print("Checking %s" % account)
        #peers =
        resposne = turbotutils.query_yes_no(
            "Do you want to break this peering?")
Exemplo n.º 3
0
    parser.add_argument('source', help='The source account. Use cluster if you wish to use the cluster as a reference')
    parser.add_argument('dest', help='The Destination account')
    args = parser.parse_args()
    if args.source == "cluster":
        filename = 'reports/guardrails/cluster_to_' + args.dest + '.csv'
    else:
        filename = 'reports/guardrails/' +  args.source + '_to_' + args.dest + '.csv'
        
    
    with open(filename, 'w') as csvfile:
        writer = csv.writer(csvfile)
        # Set to False if you do not have a valid certificate for your Turbot Host
        turbot_host_certificate_verification = True

        # Set to your Turbot Host URL
        turbot_host = turbotutils.get_turbot_host()

        # Get the access and secret key pairs
        (turbot_api_access_key, turbot_api_secret_key) = turbotutils.get_turbot_access_keys()
        urn_format = turbotutils.cluster.get_cluster_id(turbot_host, turbot_api_access_key, turbot_api_secret_key, turbot_host_certificate_verification)
        if args.source == 'cluster':
            source_account_urn = urn_format
        else:
            source_account_urn = urn_format + ':' + args.source
        dest_source_account_urn = urn_format + ':' + args.dest
        difference_count = 0

        sourceguardrails = turbotutils.guardrails.get_guardrail_list(turbot_api_access_key, turbot_api_secret_key, turbot_host_certificate_verification,
                                                                     turbot_host,
                                                                     source_account_urn)