This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
cc_api_url = 'https://api.cloudcheckr.com/api/account.json/add_account_v3' | |
headers = {'Content-Type': 'application/json'} | |
params = {'account_name': 'test_account', 'access_key': 'my_admin_api_key'} | |
r = requests.post(cc_api_url, headers=headers, params=params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_args(): | |
"""Get command line args from the user. | |
""" | |
parser = argparse.ArgumentParser( | |
description='Standard Arguments for talking to vCenter') | |
# because -h is reserved for 'help' we use -s for service | |
parser.add_argument('-s', '--host', | |
required=True, | |
action='store', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def max_rot(n): | |
n = list(str(n)) | |
answer = [int(''.join(n))] | |
for i in range(len(n)): | |
n.append(n.pop(int(i))) | |
answer.append(int(''.join(n))) | |
return max(answer) |