-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-support.py
76 lines (47 loc) · 1.34 KB
/
aws-support.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import boto3
import json
import pprint
print "AWS Support API Demo"
# s3client = boto3.client('s3')
# This is where we create the JSON as a string
# json_string = '{"first_name": "Guido", "last_name":"Rossum"}'
# This is where we parse the JSON files
#parsed_json = json.loads(json_string)
#print(parsed_json['first_name'])
#print(parsed_json['last_name'])
#my_buckets = s3client.list_buckets()
#print my_buckets
#print (my_buckets['Buckets'])
#print json.dumps(my_buckets, sort_keys=True, indent=4)
# Real stuff begins here...
client = boto3.client('support')
# Create a test case
codes = client.describe_severity_levels(
language='en'
)
#print (codes.keys())
levels = codes['severityLevels']
print type(levels)
for i in range(len(levels)):
line = levels[i]
print line['name']
# print line['code']
# print line['name']
services = client.describe_services()
#pp = pprint.PrettyPrinter()
#pp.pprint(services)
# response = client.create_case(
# subject='Test case - Please Ignore',
# serviceCode='other',
# severityCode='low',
# categoryCode='',
# communicationBody='string',
# ccEmailAddresses=[
# 'string',
# ],
# language='string',
# issueType='string',
# attachmentSetId='string'
# )
#response = client.describe_trusted_advisor_checks (language='en')
# json.dumps(response)