Skip to content

Commit 250804d

Browse files
committed
fix:Lint
1 parent 791fbd1 commit 250804d

File tree

8 files changed

+78
-80
lines changed

8 files changed

+78
-80
lines changed

examples/alarm/alarm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from nisystemlink.clients.alarm.models import (
66
AcknowledgeByInstanceIdRequest,
77
CreateOrUpdateAlarmRequest,
8-
DeleteByInstanceIdRequest,
98
QueryWithFilterRequest,
109
)
1110
from nisystemlink.clients.alarm.models._alarm import AlarmTransitionType
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from nisystemlink.clients.alarm._alarm_client import AlarmClient
22

3-
# flake8: noqa
3+
# flake8: noqa

nisystemlink/clients/alarm/_alarm_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from nisystemlink.clients import core
66
from nisystemlink.clients.core._uplink._base_client import BaseClient
77
from nisystemlink.clients.core._uplink._methods import delete, get, post
8-
from uplink import Path, retry
8+
from uplink import retry
99

1010
from . import models
1111

@@ -56,7 +56,7 @@ def create_or_update_alarm(
5656
) -> models.CreateOrUpdateAlarmResponse:
5757
"""Creates or updates an instance, or occurrence, of an alarm.
5858
59-
Creates or updates an alarm based on the requested transition and the state
59+
Creates or updates an alarm based on the requested transition and the state
6060
of the current active alarm with the given alarmId.
6161
6262
Args:
@@ -127,7 +127,7 @@ def query_alarms(
127127
request: The request containing filter information and query options.
128128
129129
Returns:
130-
A response containing the list of alarms that match the query, along with
130+
A response containing the list of alarms that match the query, along with
131131
optional total count and continuation token for pagination.
132132
133133
Raises:

nisystemlink/clients/alarm/models/_alarm.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class AlarmTransitionType(str, Enum):
1717

1818
class AlarmTransition(JsonModel):
1919
"""A transition within an instance, or occurrence, of an alarm.
20-
21-
Alarm transitions record changes to an alarm's clear field as well as an alarm
20+
21+
Alarm transitions record changes to an alarm's clear field as well as an alarm
2222
increasing or decreasing in severity.
2323
"""
2424

@@ -30,8 +30,8 @@ class AlarmTransition(JsonModel):
3030

3131
severity_level: int
3232
"""The severity of the transition.
33-
34-
Valid values for CLEAR transitions are [-1, -1].
33+
34+
Valid values for CLEAR transitions are [-1, -1].
3535
Valid values for SET transitions are [1, infinity].
3636
Note that the SystemLink Alarm UI only has display strings for SET severities in the range [1, 4].
3737
"""
@@ -50,22 +50,22 @@ class AlarmTransition(JsonModel):
5050

5151
keywords: List[str]
5252
"""Words or phrases associated with a transition.
53-
54-
Useful for attaching metadata to a transition which could aid in an investigation
53+
54+
Useful for attaching metadata to a transition which could aid in an investigation
5555
into an alarm's root cause in the future.
5656
"""
5757

5858
properties: Dict[str, str]
5959
"""Key-value pair metadata associated with a transition.
60-
61-
Useful for attaching additional metadata to a transition which could aid in an investigation
60+
61+
Useful for attaching additional metadata to a transition which could aid in an investigation
6262
into an alarm's root cause in the future. Property keys must be between 1 and 255 characters.
6363
"""
6464

6565

6666
class AlarmNote(JsonModel):
6767
"""Information about a particular alarm instance.
68-
68+
6969
Such as a description of the root cause of the alarm.
7070
"""
7171

@@ -81,9 +81,9 @@ class AlarmNote(JsonModel):
8181

8282
class Alarm(JsonModel):
8383
"""An individual instance, or occurrence, of an alarm.
84-
85-
The lifecycle of an alarm begins the first time it is triggered and ends when it has been
86-
both acknowledged and cleared. The service enforces the invariant that there can be at most
84+
85+
The lifecycle of an alarm begins the first time it is triggered and ends when it has been
86+
both acknowledged and cleared. The service enforces the invariant that there can be at most
8787
one active=True alarm with the same alarmId.
8888
"""
8989

@@ -92,8 +92,8 @@ class Alarm(JsonModel):
9292

9393
alarm_id: str
9494
"""A value meant to uniquely identify the particular process or condition tracked by the alarm.
95-
96-
For example, alarms created by a tag rule engine might have their alarmIds set to the
95+
96+
For example, alarms created by a tag rule engine might have their alarmIds set to the
9797
concatenation of the path of the tag which caused the rule to be triggered and the ID of the rule.
9898
"""
9999

@@ -102,38 +102,38 @@ class Alarm(JsonModel):
102102

103103
active: bool
104104
"""Whether or not the alarm is active.
105-
106-
An active alarm deserves human or automated attention. Alarms always begin life with active=True.
105+
106+
An active alarm deserves human or automated attention. Alarms always begin life with active=True.
107107
This field will be automatically set to false when the clear and acknowledged fields are set to true.
108108
"""
109109

110110
clear: bool
111111
"""When set to true, the condition that triggered the alarm no longer matches the trigger condition.
112-
113-
When an alarm is created, clear is initially set to false. The creator of the alarm (typically a
114-
rule engine or application element of some sort) may determine that the trigger condition no longer
115-
applies, and may send an update, clearing the alarm. Clearing the alarm does not deactivate the alarm,
116-
unless the alarm had previously been acknowledged. As long as the alarm is active=true, the alarm may
112+
113+
When an alarm is created, clear is initially set to false. The creator of the alarm (typically a
114+
rule engine or application element of some sort) may determine that the trigger condition no longer
115+
applies, and may send an update, clearing the alarm. Clearing the alarm does not deactivate the alarm,
116+
unless the alarm had previously been acknowledged. As long as the alarm is active=true, the alarm may
117117
transition from clear=True to clear=False (or vice versa) multiple times.
118118
"""
119119

120120
acknowledged: bool
121121
"""When set to true, the alarm has been acknowledged by an alarm handler, which is typically a human.
122-
123-
Alarms always begin life with acknowledged=False. Acknowledging an alarm will not affect the active
124-
flag unless clear is also true. When clear and acknowledged are true, the alarm will become inactive
122+
123+
Alarms always begin life with acknowledged=False. Acknowledging an alarm will not affect the active
124+
flag unless clear is also true. When clear and acknowledged are true, the alarm will become inactive
125125
(active=False). This field is automatically reset to false when the alarm's highestSeverityLevel field increases.
126126
"""
127127

128128
acknowledged_at: Optional[datetime]
129129
"""The date and time when the alarm instance was acknowledged.
130-
130+
131131
This field will be cleared when the alarm's highestSeverityLevel field increases.
132132
"""
133133

134134
acknowledged_by: Optional[str]
135135
"""The userId of the individual who acknowledged the alarm.
136-
136+
137137
This field will be cleared when the alarm's highestSeverityLevel field increases.
138138
"""
139139

@@ -145,28 +145,28 @@ class Alarm(JsonModel):
145145

146146
created_by: str
147147
"""An identifier for who or what created the alarm.
148-
148+
149149
This is usually used to identify the particular rule engine which requested that the alarm be created.
150150
"""
151151

152152
transitions: List[AlarmTransition]
153153
"""A collection of AlarmTransitions for the alarm.
154-
155-
The service stores the first transition and the most recent 99 other transitions by default.
154+
155+
The service stores the first transition and the most recent 99 other transitions by default.
156156
The configuration for the service determines the total number of stored transitions per alarm.
157157
"""
158158

159159
transition_overflow_count: int
160160
"""The number of transitions which overflowed the transitions field for the alarm.
161-
162-
For example, if the alarm transitioned 250 times, transitionOverflowCount is set to 150 and
163-
transitions contains the first and most recent 99 transitions. The configuration for the service
161+
162+
For example, if the alarm transitioned 250 times, transitionOverflowCount is set to 150 and
163+
transitions contains the first and most recent 99 transitions. The configuration for the service
164164
determines the total number of stored transitions per alarm.
165165
"""
166166

167167
notification_strategy_ids: List[str]
168168
"""The IDs of the notification strategies which will be triggered.
169-
169+
170170
These are triggered when the alarm is first created and when its highestSeverityLevel increases.
171171
"""
172172

@@ -178,13 +178,13 @@ class Alarm(JsonModel):
178178

179179
most_recent_set_occurred_at: Optional[datetime]
180180
"""The date and time of the most recent occurrence of a SET transition.
181-
181+
182182
This property only considers transitions that cause an alarm state change.
183183
"""
184184

185185
most_recent_transition_occurred_at: Optional[datetime]
186186
"""The date and time of the most recent occurrence of a transition.
187-
187+
188188
This property only considers transitions that cause an alarm state change.
189189
"""
190190

@@ -202,13 +202,13 @@ class Alarm(JsonModel):
202202

203203
keywords: List[str]
204204
"""Words or phrases associated with the alarm.
205-
205+
206206
Alarms can be tagged with keywords to make it easier to find them with queries.
207207
"""
208208

209209
notes: List[AlarmNote]
210210
"""A collection of notes for a given alarm instance.
211-
211+
212212
Notes are set by humans to record information such as the root cause of the alarm.
213213
"""
214214

nisystemlink/clients/alarm/models/_create_or_update_alarm_request.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class CreateAlarmTransition(JsonModel):
1717

1818
severity_level: Optional[int] = 2
1919
"""The severity of the transition.
20-
21-
Valid values for CLEAR transitions are [-1, -1].
20+
21+
Valid values for CLEAR transitions are [-1, -1].
2222
Valid values for SET transitions are [1, infinity].
2323
Note that the SystemLink Alarm UI only has display strings for SET severities in the range [1, 4].
2424
"""
@@ -37,36 +37,36 @@ class CreateAlarmTransition(JsonModel):
3737

3838
keywords: Optional[List[str]] = None
3939
"""Words or phrases associated with a transition.
40-
41-
Useful for attaching metadata to a transition which could aid in an investigation
40+
41+
Useful for attaching metadata to a transition which could aid in an investigation
4242
into an alarm's root cause in the future.
4343
"""
4444

4545
properties: Optional[Dict[str, str]] = None
4646
"""Key-value pair metadata associated with a transition.
47-
48-
Useful for attaching additional metadata to a transition which could aid in an investigation
47+
48+
Useful for attaching additional metadata to a transition which could aid in an investigation
4949
into an alarm's root cause in the future. Property keys must be between 1 and 255 characters.
5050
Property values can be up to 1000 characters.
5151
"""
5252

5353

5454
class CreateOrUpdateAlarmRequest(JsonModel):
5555
"""Contains information about the alarm to create or update.
56-
56+
5757
If an alarm is being updated, only alarmId, workspace, and transition are applied.
5858
"""
5959

6060
alarm_id: str
6161
"""A value meant to uniquely identify the particular process or condition tracked by the alarm.
62-
63-
For example, alarms created by a tag rule engine might have their alarmIds set to the
62+
63+
For example, alarms created by a tag rule engine might have their alarmIds set to the
6464
concatenation of the path of the tag which caused the rule to be triggered and the ID of the rule.
6565
"""
6666

6767
workspace: Optional[str] = None
6868
"""The ID of the workspace in which to create or update the alarm.
69-
69+
7070
When not specified, the default workspace is used based on the requesting user.
7171
"""
7272

@@ -75,15 +75,15 @@ class CreateOrUpdateAlarmRequest(JsonModel):
7575

7676
notification_strategy_ids: Optional[List[str]] = None
7777
"""The IDs of the notification strategies which should be triggered.
78-
79-
These are triggered if this request results in an alarm being created or
78+
79+
These are triggered if this request results in an alarm being created or
8080
transitioning to a new highest severity.
8181
"""
8282

8383
created_by: Optional[str] = None
8484
"""An identifier for who or what created the alarm.
85-
86-
This is usually used to identify the particular rule engine which requested
85+
86+
This is usually used to identify the particular rule engine which requested
8787
that the alarm be created.
8888
"""
8989

@@ -101,7 +101,7 @@ class CreateOrUpdateAlarmRequest(JsonModel):
101101

102102
keywords: Optional[List[str]] = None
103103
"""Words or phrases associated with the alarm.
104-
104+
105105
Alarms can be tagged with keywords to make it easier to find them with queries.
106106
"""
107107

0 commit comments

Comments
 (0)