Skip to content

Commit 018d878

Browse files
authored
Merge branch 'main' into add_CF_template_to_mon_services
2 parents 1363319 + 0c4679c commit 018d878

File tree

4 files changed

+52
-9
lines changed

4 files changed

+52
-9
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# Copyright (c) NetApp, Inc.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: "Update Cloudformation Template"
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- 'Monitoring/monitor-ontap-services/monitor_ontap_services.py'
11+
push:
12+
paths:
13+
- 'Monitoring/monitor-ontap-services/monitor_ontap_services.py'
14+
branches:
15+
- main
16+
17+
jobs:
18+
update-Cloudformation-Template:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Give the default GITHUB_TOKEN write permission to commit and push the
22+
# added or changed files to the repository.
23+
contents: write
24+
25+
steps:
26+
- name: Checkout pull request
27+
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
31+
- name: Update the Cloudformation Template
32+
shell: bash
33+
working-directory: Monitoring/monitor-ontap-services
34+
run: ./updateMonOntapServiceCFTemplate
35+
36+
- name: Commit the changes
37+
uses: stefanzweifel/git-auto-commit-action@v5

Management-Utilities/auto_set_fsxn_auto_grow/set_fsxn_volume_auto_grow.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
# Create a table of secret names and keys for the username and password for
3131
# each of the FSxIds. In the example below, it shows using the same
32-
# secret for four differnt FSxIds, but you can set it up to use
32+
# secret for four different FSxIds, but you can set it up to use
3333
# a different secret and/or keys for the username and password for each
3434
# of the FSxId.
3535
secretsTable = [
@@ -66,7 +66,7 @@
6666
# Set the minimum shirtk size for the volume in terms of the percentage of the provisioned size.
6767
minShrinkSizePercentage = 100
6868
#
69-
# Set the iime to wait for a volume to get created. This Lambda function will
69+
# Set the time to wait for a volume to get created. This Lambda function will
7070
# loop waiting for the volume to be created on the ONTAP side so it can set
7171
# the auto size parameters. It will wait up to the number of seconds specified
7272
# below before giving up. NOTE: You must set the timeout of this function
@@ -154,7 +154,9 @@ def lambda_handler(event, context):
154154

155155
if 'secretsTable' not in globals():
156156
if 'dynamodbRegion' not in globals() or 'dynamodbSecretsTableName' not in globals():
157-
raise Exception('Error, you must either define the secretsTable array at the top of this script, or define dynamodbRegion and dynamodbSecretsTableName.')
157+
message = 'Error, you must either define the secretsTable array at the top of this script, or define dynamodbRegion and dynamodbSecretsTableName.'
158+
logger.critcal(message)
159+
raise Exception(message)
158160

159161
table = dynamodbClient.Table(dynamodbSecretsTableName) # pylint: disable=E0602
160162

@@ -170,7 +172,8 @@ def lambda_handler(event, context):
170172
if fsxId == "" or regionName == "" or volumeId == "" or volumeName == "" or volumeARN == "":
171173
message = "Couldn't obtain the fsxId, region, volume name, volume ID or volume ARN from the CloudWatch evevnt."
172174
logger.critcal(message)
173-
raise Exception(message)
175+
# raise Exception(message)
176+
return
174177

175178
logger.debug(f'Data from CloudWatch event: FSxID={fsxId}, Region={regionName}, VolumeName={volumeName}, volumeId={volumeId}.')
176179
#
@@ -179,7 +182,8 @@ def lambda_handler(event, context):
179182
if username == "" or password == "":
180183
message = f'No credentials for FSxN ID: {fsxId}.'
181184
logger.critical(message)
182-
raise Exception(message)
185+
# raise Exception(message)
186+
return
183187
#
184188
# Build a header that is used for all the ONTAP API requests.
185189
auth = urllib3.make_headers(basic_auth=f'{username}:{password}')
@@ -192,14 +196,16 @@ def lambda_handler(event, context):
192196
if fsxnIp == "":
193197
message = f"Can't find management IP for FSxN file system with an ID of '{fsxId}'."
194198
logger.critical(message)
195-
raise Exception(message)
199+
# raise Exception(message)
200+
return
196201
#
197202
# Get the volume UUID and volume size based on the volume ID.
198203
volumeData = getVolumeData(fsxClient, volumeId, volumeARN)
199204
if volumeData == None:
200205
message=f'Failed to get volume information for volumeID: {volumeId}.'
201206
logger.critical(message)
202-
raise Exception(message)
207+
# raise Exception(message)
208+
return
203209
volumeUUID = volumeData["OntapConfiguration"]["UUID"]
204210
volumeSizeInMegabytes = volumeData["OntapConfiguration"]["SizeInMegabytes"]
205211
#

Monitoring/monitor-ontap-services/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Each rule should be an object with one, or more, of the following keys:
290290
},
291291
{
292292
"name": "",
293-
"severity": "notice|info|error|alert|emergency",
293+
"severity": "alert|emergency",
294294
"message": ""
295295
}
296296
]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ built to maximize cost performance, resilience, and accessibility in business-cr
88
This GitHub repository contains comprehensive code samples and automation scripts for FSx for Netapp ONTAP operations,
99
promoting the use of Infrastructure as Code (IAC) tools and encouraging developers to extend the product's
1010
functionalities through code. The samples here go alongside the automation, management and monitoring that
11-
[BlueXP Workload Factory](https://www.netapp.com/bluexp/workload-factory/) provides.
11+
[BlueXP Workload Factory](https://console.workloads.netapp.com) provides.
1212

1313
We welcome contributions from the community! Please read our [contribution guidelines](CONTRIBUTING.md) before getting started.
1414

0 commit comments

Comments
 (0)