@@ -486,15 +486,117 @@ def get_resource_group_level_alerts(
486486 return deserialized
487487 get_resource_group_level_alerts .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}' }
488488
489- def update_subscription_level_alert_state (
490- self , alert_name , alert_update_action_type , custom_headers = None , raw = False , ** operation_config ):
489+ def update_subscription_level_alert_state_to_dismiss (
490+ self , alert_name , custom_headers = None , raw = False , ** operation_config ):
491+ """Update the alert's state.
492+
493+ :param alert_name: Name of the alert object
494+ :type alert_name: str
495+ :param dict custom_headers: headers that will be added to the request
496+ :param bool raw: returns the direct response alongside the
497+ deserialized response
498+ :param operation_config: :ref:`Operation configuration
499+ overrides<msrest:optionsforoperations>`.
500+ :return: None or ClientRawResponse if raw=true
501+ :rtype: None or ~msrest.pipeline.ClientRawResponse
502+ :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
503+ """
504+ # Construct URL
505+ url = self .update_subscription_level_alert_state_to_dismiss .metadata ['url' ]
506+ path_format_arguments = {
507+ 'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' , pattern = r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$' ),
508+ 'ascLocation' : self ._serialize .url ("self.config.asc_location" , self .config .asc_location , 'str' ),
509+ 'alertName' : self ._serialize .url ("alert_name" , alert_name , 'str' )
510+ }
511+ url = self ._client .format_url (url , ** path_format_arguments )
512+
513+ # Construct parameters
514+ query_parameters = {}
515+ query_parameters ['api-version' ] = self ._serialize .query ("self.api_version" , self .api_version , 'str' )
516+
517+ # Construct headers
518+ header_parameters = {}
519+ if self .config .generate_client_request_id :
520+ header_parameters ['x-ms-client-request-id' ] = str (uuid .uuid1 ())
521+ if custom_headers :
522+ header_parameters .update (custom_headers )
523+ if self .config .accept_language is not None :
524+ header_parameters ['accept-language' ] = self ._serialize .header ("self.config.accept_language" , self .config .accept_language , 'str' )
525+
526+ # Construct and send request
527+ request = self ._client .post (url , query_parameters , header_parameters )
528+ response = self ._client .send (request , stream = False , ** operation_config )
529+
530+ if response .status_code not in [204 ]:
531+ exp = CloudError (response )
532+ exp .request_id = response .headers .get ('x-ms-request-id' )
533+ raise exp
534+
535+ if raw :
536+ client_raw_response = ClientRawResponse (None , response )
537+ return client_raw_response
538+ update_subscription_level_alert_state_to_dismiss .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss' }
539+
540+ def update_subscription_level_alert_state_to_reactivate (
541+ self , alert_name , custom_headers = None , raw = False , ** operation_config ):
542+ """Update the alert's state.
543+
544+ :param alert_name: Name of the alert object
545+ :type alert_name: str
546+ :param dict custom_headers: headers that will be added to the request
547+ :param bool raw: returns the direct response alongside the
548+ deserialized response
549+ :param operation_config: :ref:`Operation configuration
550+ overrides<msrest:optionsforoperations>`.
551+ :return: None or ClientRawResponse if raw=true
552+ :rtype: None or ~msrest.pipeline.ClientRawResponse
553+ :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
554+ """
555+ # Construct URL
556+ url = self .update_subscription_level_alert_state_to_reactivate .metadata ['url' ]
557+ path_format_arguments = {
558+ 'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' , pattern = r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$' ),
559+ 'ascLocation' : self ._serialize .url ("self.config.asc_location" , self .config .asc_location , 'str' ),
560+ 'alertName' : self ._serialize .url ("alert_name" , alert_name , 'str' )
561+ }
562+ url = self ._client .format_url (url , ** path_format_arguments )
563+
564+ # Construct parameters
565+ query_parameters = {}
566+ query_parameters ['api-version' ] = self ._serialize .query ("self.api_version" , self .api_version , 'str' )
567+
568+ # Construct headers
569+ header_parameters = {}
570+ if self .config .generate_client_request_id :
571+ header_parameters ['x-ms-client-request-id' ] = str (uuid .uuid1 ())
572+ if custom_headers :
573+ header_parameters .update (custom_headers )
574+ if self .config .accept_language is not None :
575+ header_parameters ['accept-language' ] = self ._serialize .header ("self.config.accept_language" , self .config .accept_language , 'str' )
576+
577+ # Construct and send request
578+ request = self ._client .post (url , query_parameters , header_parameters )
579+ response = self ._client .send (request , stream = False , ** operation_config )
580+
581+ if response .status_code not in [204 ]:
582+ exp = CloudError (response )
583+ exp .request_id = response .headers .get ('x-ms-request-id' )
584+ raise exp
585+
586+ if raw :
587+ client_raw_response = ClientRawResponse (None , response )
588+ return client_raw_response
589+ update_subscription_level_alert_state_to_reactivate .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate' }
590+
591+ def update_resource_group_level_alert_state_to_dismiss (
592+ self , alert_name , resource_group_name , custom_headers = None , raw = False , ** operation_config ):
491593 """Update the alert's state.
492594
493595 :param alert_name: Name of the alert object
494596 :type alert_name: str
495- :param alert_update_action_type: Type of the action to do on the
496- alert. Possible values include: 'Dismiss', 'Reactivate'
497- :type alert_update_action_type : str
597+ :param resource_group_name: The name of the resource group within the
598+ user's subscription. The name is case insensitive.
599+ :type resource_group_name : str
498600 :param dict custom_headers: headers that will be added to the request
499601 :param bool raw: returns the direct response alongside the
500602 deserialized response
@@ -505,12 +607,12 @@ def update_subscription_level_alert_state(
505607 :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
506608 """
507609 # Construct URL
508- url = self .update_subscription_level_alert_state .metadata ['url' ]
610+ url = self .update_resource_group_level_alert_state_to_dismiss .metadata ['url' ]
509611 path_format_arguments = {
510612 'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' , pattern = r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$' ),
511613 'ascLocation' : self ._serialize .url ("self.config.asc_location" , self .config .asc_location , 'str' ),
512614 'alertName' : self ._serialize .url ("alert_name" , alert_name , 'str' ),
513- 'alertUpdateActionType ' : self ._serialize .url ("alert_update_action_type " , alert_update_action_type , 'str' )
615+ 'resourceGroupName ' : self ._serialize .url ("resource_group_name " , resource_group_name , 'str' , max_length = 90 , min_length = 1 , pattern = r'^[-\w\._\(\)]+$ ' )
514616 }
515617 url = self ._client .format_url (url , ** path_format_arguments )
516618
@@ -539,17 +641,14 @@ def update_subscription_level_alert_state(
539641 if raw :
540642 client_raw_response = ClientRawResponse (None , response )
541643 return client_raw_response
542- update_subscription_level_alert_state .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType} ' }
644+ update_resource_group_level_alert_state_to_dismiss .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss ' }
543645
544- def update_resource_group_level_alert_state (
545- self , alert_name , alert_update_action_type , resource_group_name , custom_headers = None , raw = False , ** operation_config ):
646+ def update_resource_group_level_alert_state_to_reactivate (
647+ self , alert_name , resource_group_name , custom_headers = None , raw = False , ** operation_config ):
546648 """Update the alert's state.
547649
548650 :param alert_name: Name of the alert object
549651 :type alert_name: str
550- :param alert_update_action_type: Type of the action to do on the
551- alert. Possible values include: 'Dismiss', 'Reactivate'
552- :type alert_update_action_type: str
553652 :param resource_group_name: The name of the resource group within the
554653 user's subscription. The name is case insensitive.
555654 :type resource_group_name: str
@@ -563,12 +662,11 @@ def update_resource_group_level_alert_state(
563662 :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
564663 """
565664 # Construct URL
566- url = self .update_resource_group_level_alert_state .metadata ['url' ]
665+ url = self .update_resource_group_level_alert_state_to_reactivate .metadata ['url' ]
567666 path_format_arguments = {
568667 'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' , pattern = r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$' ),
569668 'ascLocation' : self ._serialize .url ("self.config.asc_location" , self .config .asc_location , 'str' ),
570669 'alertName' : self ._serialize .url ("alert_name" , alert_name , 'str' ),
571- 'alertUpdateActionType' : self ._serialize .url ("alert_update_action_type" , alert_update_action_type , 'str' ),
572670 'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' , max_length = 90 , min_length = 1 , pattern = r'^[-\w\._\(\)]+$' )
573671 }
574672 url = self ._client .format_url (url , ** path_format_arguments )
@@ -598,4 +696,4 @@ def update_resource_group_level_alert_state(
598696 if raw :
599697 client_raw_response = ClientRawResponse (None , response )
600698 return client_raw_response
601- update_resource_group_level_alert_state .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType} ' }
699+ update_resource_group_level_alert_state_to_reactivate .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate ' }
0 commit comments