11"""Implementation of Alarm Client"""
22
3- from typing import Optional
3+ from typing import List , Optional
44
55from nisystemlink .clients import core
66from nisystemlink .clients .core ._uplink ._base_client import BaseClient
77from nisystemlink .clients .core ._uplink ._methods import delete , get , post
8- from uplink import Field , retry
8+ from uplink import Field , Path , retry
99
1010from . import models
1111
@@ -38,15 +38,15 @@ def __init__(self, configuration: Optional[core.HttpConfiguration] = None):
3838 "acknowledge-instances-by-instance-id" ,
3939 args = [Field ("instanceIds" ), Field ("forceClear" )],
4040 )
41- def acknowledge_alarm (
42- self , instance_ids : list [str ], force_clear : bool = False
43- ) -> models .AcknowledgeByInstanceIdResponse :
41+ def acknowledge_alarms (
42+ self , ids : List [str ], force_clear : bool = False
43+ ) -> models .AcknowledgeAlarmsResponse :
4444 """Acknowledges one or more alarm instances by their instance IDs.
4545
4646 Args:
47- instance_ids : List of instance IDs (unique occurrence identifiers) of the alarms to acknowledge.
48- These are the server-generated IDs returned when creating/updating alarms,
49- not the user-defined alarm_id.
47+ ids : List of instance IDs (unique occurrence identifiers) of the alarms to acknowledge.
48+ These are the server-generated IDs returned when creating/updating alarms,
49+ not the user-defined alarm_id.
5050 force_clear: Whether or not the affected alarms should have their clear field set to true.
5151 Defaults to False.
5252
@@ -80,14 +80,14 @@ def create_or_update_alarm(self, request: models.CreateOrUpdateAlarmRequest) ->
8080 """
8181 ...
8282
83- @get ("instances/{instance_id}" )
84- def get_alarm (self , instance_id : str ) -> models .Alarm :
83+ @get ("instances/{instance_id}" , args = [ Path ( "instance_id" )] )
84+ def get_alarm (self , id : str ) -> models .Alarm :
8585 """Gets an alarm by its instance_id.
8686
8787 Args:
88- instance_id : The unique instance ID (occurrence identifier) of the alarm to retrieve.
89- This is the server-generated ID returned from create_or_update_alarm(),
90- not the user-defined alarm_id.
88+ id : The unique instance ID (occurrence identifier) of the alarm to retrieve.
89+ This is the server-generated ID returned from create_or_update_alarm(),
90+ not the user-defined alarm_id.
9191
9292 Returns:
9393 The alarm with the specified instance_id.
@@ -97,30 +97,30 @@ def get_alarm(self, instance_id: str) -> models.Alarm:
9797 """
9898 ...
9999
100- @delete ("instances/{instance_id}" )
101- def delete_alarm (self , instance_id : str ) -> None :
100+ @delete ("instances/{instance_id}" , args = [ Path ( "instance_id" )] )
101+ def delete_alarm (self , id : str ) -> None :
102102 """Deletes an alarm by its instance_id.
103103
104104 Args:
105- instance_id : The unique instance ID (occurrence identifier) of the alarm to delete.
106- This is the server-generated ID returned from create_or_update_alarm(),
107- not the user-defined alarm_id.
105+ id : The unique instance ID (occurrence identifier) of the alarm to delete.
106+ This is the server-generated ID returned from create_or_update_alarm(),
107+ not the user-defined alarm_id.
108108
109109 Raises:
110110 ApiException: if unable to communicate with the `/nialarm` Service or provided invalid arguments.
111111 """
112112 ...
113113
114114 @post ("delete-instances-by-instance-id" , args = [Field ("instanceIds" )])
115- def delete_instances_by_instance_id (
116- self , instance_ids : list [str ]
115+ def delete_alarms (
116+ self , ids : List [str ]
117117 ) -> models .DeleteByInstanceIdResponse :
118118 """Deletes multiple alarm instances by their instance IDs.
119119
120120 Args:
121- instance_ids : List of instance IDs (unique occurrence identifiers) of the alarms to delete.
122- These are the server-generated IDs returned when creating/updating alarms,
123- not the user-defined alarm_id.
121+ ids : List of instance IDs (unique occurrence identifiers) of the alarms to delete.
122+ These are the server-generated IDs returned when creating/updating alarms,
123+ not the user-defined alarm_id.
124124
125125 Returns:
126126 A response containing lists of successfully deleted and failed instance IDs,
@@ -133,8 +133,8 @@ def delete_instances_by_instance_id(
133133
134134 @post ("query-instances-with-filter" )
135135 def query_alarms (
136- self , request : models .QueryWithFilterRequest
137- ) -> models .QueryWithFilterResponse :
136+ self , request : models .QueryAlarmsWithFilterRequest
137+ ) -> models .QueryAlarmsWithFilterResponse :
138138 """Queries for instances, or occurrences, of alarms using Dynamic LINQ.
139139
140140 Specifying an empty JSON object in the request body will result in all alarms being returned.
0 commit comments