forked from shaniacht1/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautomation-AwsStopInstance.yml
More file actions
38 lines (36 loc) · 1.12 KB
/
automation-AwsStopInstance.yml
File metadata and controls
38 lines (36 loc) · 1.12 KB
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
args:
- default: true
description: instance ID
name: instanceId
required: true
- description: ' Forces the instances to stop (Default: false). The instances do not
have an opportunity to flush file system caches or file system metadata. If you
use this option, you must perform file system check and repair procedures. This
option is not recommended for Windows instances.'
name: force
comment: stop ec2 aws instances
commonfields:
id: AwsStopInstance
version: -1
dependson:
must:
- stop-instance
name: AwsStopInstance
runonce: false
script: |2
resp = demisto.executeCommand("stop-instance", demisto.args())
if isError(resp[0]):
demisto.results(resp)
else:
data = demisto.get(resp[0], "Contents.StopInstancesResponse")
if data:
data = data if isinstance(data, list) else [data]
data = [{k: formatCell(row[k]) for k in row} for row in data]
demisto.results({"ContentsFormat": formats["table"], "Type": entryTypes["note"], "Contents": data} )
else:
demisto.results("No results.")
scripttarget: 0
system: true
tags:
- Amazon Web Services
type: python