o
    #jOV                     @   s  d Z G dd deZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd  d eZG d!d" d"eZG d#d$ d$eZG d%d& d&eZG d'd( d(eZG d)d* d*eZG d+d, d,eZG d-d. d.eZG d/d0 d0eZG d1d2 d2eZG d3d4 d4eZd5S )6z-
This module provides a model class for BCM.
c                       "   e Zd ZdZd fdd	Z  ZS )CustomDimensionModelz-
    This class define custom dimension.
     c                    *   t t|   || d< || d< || d< dS )a  
        :param name:
            custom dimension name.
        :type name: string

        :param alias:
            custom dimension alias.
        :type alias: string

        :param order:
            custom dimension order.
        :type order: int
        nameorderaliasN)superr   __init__)selfr   r   r   	__class__ `/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/baidubce/services/bcm/bcm_model.pyr	      s   zCustomDimensionModel.__init__r   __name__
__module____qualname____doc__r	   __classcell__r   r   r   r   r          r   c                   @   sD   e Zd ZdZdZdZdZdZeeeefZe	dd Z
e	dd	 Zd
S )
EventLevelz(
    This class define event level.
    NOTICEWARNINGMAJORCRITICALc                 C   s   || j v rdS dS )z
        whether event_level is valid

        :param event_level:
            event level
        :type event_level: string

        :return:
        :rtype true/false
        TF_EventLevel__all_members)clsevent_levelr   r   r   contains5   s   
zEventLevel.containsc                 C   s   | j S )zM
        get all event levels

        :return:
        :rtype tuple
        r   )r   r   r   r   all_event_levelsE   s   zEventLevel.all_event_levelsN)r   r   r   r   r   r   r   r   r   classmethodr    r!   r   r   r   r   r   +   s    
r   c                           e Zd ZdZ fddZ  ZS )DisableTimez(
    This class define disable time
    c                    "   t t|   || d< || d< dS )z

        :param from_time: disable start time, such as 08:00:00
        :type from_time: string
        :param to_time: disable end time, such as 08:00:00
        :type to_time: string
        fromtoN)r   r$   r	   )r
   Z	from_timeZto_timer   r   r   r	   U      zDisableTime.__init__r   r   r   r   r   r$   P       r$   c                       r   )Notificationz(
    This class define notification
    r   c                    r%   )z

        :param type: enum, EMAIL, SMS, PHONE
        :type type: string
        :param receiver: receiver id
        :type receiver string
        typereceiverN)r   r*   r	   )r
   r+   r,   r   r   r   r	   g   r(   zNotification.__init__r   r   r   r   r   r   r*   b   r   r*   c                       r#   )Memberz"
    This class define member
    c                    r   )z

        :param type: enum, notifyParty or notifyGroup
        :type type: string
        :param id: receiver id
        :type id string
        :param name: receiver's name
        :type name: string
        r+   idr   N)r   r-   r	   )r
   r+   r.   r   r   r   r   r	   y      
zMember.__init__r   r   r   r   r   r-   t   r)   r-   c                       r#   )ApplicationAlarmRulez;
    This class define application alarm policy config
    c
           
         sb   t t|   || d< || d< || d< || d< || d< d| d< || d< || d	< || d
< |	| d< dS )a  

        :param metric: metric identifier
        :type metric: string
        :param metric_alias: metric name
        :type metric_alias: string
        :param cycle: period, second
        :type cycle: int
        :param statistics: statistics, enum: average, minimum, maximum, sum
        :type statistics: string
        :param threshold:
        :type threshold: float
        :param comparison_operator: operator, enum: ">", "<", ">=", "<="
        :type: string
        :param count:
        :type count: int
        :param sequence: rule's sequence, begin with 0
        :type sequence: int
        :param metric_dimensions: dimensions
        :type metric_dimensions: list
        metricmetricAliascycle
statistics	threshold	THRESHOLDfunctioncomparisonOperatorcountsequencemetricDimensionsN)r   r0   r	   )
r
   r1   metric_aliasr3   r4   r5   comparison_operatorr9   r:   metric_dimensionsr   r   r   r	      s   zApplicationAlarmRule.__init__r   r   r   r   r   r0      r)   r0   c                       r   )ApplicationObjectViewzN
    This class define the monitorObjectView in application monitor alarm
    r   c                    r   )a  

        :param monitor_object_name: taskName
        :type monitor_object_name: string
        :param monitor_object_name_view: displayed name
        :type monitor_object_name_view: string
        :param metric_dimension_view:
        :type string
        ZmonitorObjectNameZmonitorObjectNameViewZmetricDimensionViewN)r   r?   r	   )r
   Zmonitor_object_nameZmonitor_object_name_viewZmetric_dimension_viewr   r   r   r	      r/   zApplicationObjectView.__init__)r   r   r   r   r   r   r   r?      r   r?   c                       r#   )ApplicationMonitorObjectz6
    This class define application monitor object
    c                    r%   )z

        :param monitor_object_type: enum: APP, SERVICE
        :type monitor_object_type: string
        :param monitor_object_view: monitor object
        :type monitor_object_view: list
        monitorObjectTypeZmonitorObjectViewN)r   r@   r	   )r
   monitor_object_typeZmonitor_object_viewr   r   r   r	      r(   z!ApplicationMonitorObject.__init__r   r   r   r   r   r@      r)   r@   c                       r#   )	Dimensionz&
    This class define dimension.
    c                    r%   )z
        :param name: dimension name.
        :type name: string

        :param value: dimension value.
        :type value: string
        r   valueN)r   rC   r	   )r
   r   rD   r   r   r   r	      r(   zDimension.__init__r   r   r   r   r   rC          rC   c                       r#   )KVz
    This class define kv.
    c                    r%   )z
        :param key: key.
        :type key: string

        :param value: dimension value.
        :type value: string
        keyrD   N)r   rF   r	   )r
   rG   rD   r   r   r   r	      r(   zKV.__init__r   r   r   r   r   rF      rE   rF   c                       r   )PolicyResourcez,
    This class define policy resource.
    Nc                    s.   t t|   |du rg }|| d< || d< dS )z
        :param identifiers: identifiers.
        :type identifiers: Dimension array

        :param metric_dimensions: metric dimensions.
        :type metric_dimensions: Dimension array
        Nidentifiersr;   )r   rH   r	   )r
   rI   r>   r   r   r   r	      s
   zPolicyResource.__init__Nr   r   r   r   r   rH          rH   c                       "   e Zd ZdZd fdd	Z  ZS )MonitorObjectz+
    This class define monitor object.
    NInstancec                    s>   t t|   |du rg }|| d< || d< || d< || d< dS )ab  
        :param object_type: monitor object type.
        :type object_type: string

        :param names: monitor object names.
        :type names: string array

        :param resources: monitor object resources.
        :type resources: PolicyResource array

        :param type_name: monitor object typename.
        :type type_name: string
        Nr+   names	resourcestypeName)r   rM   r	   )r
   Zobject_typerO   rP   	type_namer   r   r   r	     s   zMonitorObject.__init__)NrN   r   r   r   r   r   rM     rK   rM   c                       s$   e Zd ZdZ	d fdd	Z  ZS )	AlarmRulea:  

    private Long index;
    private String metric;
    private Long periodInSecond;
    private String statistics;
    private String threshold;
    private String comparisonOperator;
    private Integer evaluationPeriodCount;
    private List<Dimension> metricDimensions;

    This class define alarm rule.
    Nc	           	         s^   t t|   |du rg }|| d< || d< || d< || d< || d< || d< || d< || d	< dS )
as  
        :param index: alarm rule index.
        :type index: int

        :param metric: metric name.
        :type metric: string

        :param period: period in second.
        :type period: int

        :param statistics: statistics.
        :type statistics: string

        :param threshold: threshold.
        :type threshold: string

        :param operator: comparison operator.
        :type operator: string

        :param evaluation_count: evaluation period count.
        :type evaluation_count: int

        :param metric_dimensions: metric dimensions.
        :type metric_dimensions: Dimension array
        Nindexr1   ZperiodInSecondr4   r5   r8   ZevaluationPeriodCountr;   )r   rS   r	   )	r
   rT   r1   Zperiodr4   r5   operatorZevaluation_countr>   r   r   r   r	   7  s   zAlarmRule.__init__rJ   r   r   r   r   r   rS   )  s    rS   c                       r   )AlarmActionz)
    This class define alarm action.
    r   c                    r%   )z~
        :param name: action name.
        :type name: string

        :param id: action id.
        :type id: string
        r   r.   N)r   rV   r	   )r
   r   Z	action_idr   r   r   r	   c  r(   zAlarmAction.__init__r   r   r   r   r   r   rV   _  rK   rV   c                       rL   )AlarmConfigRulez.
    This class define alarm config rule.
    <   Nc                    sN   t t|   |du rg }|| d< || d< || d< || d< || d< || d< dS )a  
        :param metric_name: metric name.
        :type metric_name: string

        :param operator: operator.
        :type operator: string

        :param statistics: statistics.
        :type statistics: string

        :param threshold: threshold.
        :type threshold: float

        :param window: window.
        :type window: int

        :param metric_dimensions: metric dimensions.
        :type metric_dimensions: KV array
        N
metricNamerU   r4   r5   windowr;   )r   rW   r	   )r
   metric_namerU   r4   r5   rZ   r>   r   r   r   r	   t  s   zAlarmConfigRule.__init__)rX   Nr   r   r   r   r   rW   p  rK   rW   c                       r#   )AlarmConfigPolicyz0
    This class define alarm config policy.
    c                    r%   )z
        :param rules: alarm config rules.
        :type rules: AlarmConfigRule array

        :param alarm_pending_count: alarm pending period count.
        :type alarm_pending_count: int
        rulesZalarmPendingPeriodCountN)r   r\   r	   )r
   r]   Zalarm_pending_countr   r   r   r	     r(   zAlarmConfigPolicy.__init__r   r   r   r   r   r\     rE   r\   c                       r   )TargetInstancez@
    This class define alarm config policy target instance.
    Nc                    s6   t t|   |du rg }|| d< || d< || d< dS )z
        :param region: region.
        :type region: string

        :param identifiers: identifiers.
        :type identifiers: KV array

        :param metric_dimensions: metric dimensions.
        :type metric_dimensions: KV array
        NregionrI   r;   )r   r^   r	   )r
   r_   rI   r>   r   r   r   r	     s   zTargetInstance.__init__rJ   r   r   r   r   r   r^     rK   r^   c                       r#   )EventFilterz(
    This class define event filter
    c                    r   )aP  
        :param event_level: event level, enum: NOTICE, WARNING, MAJOR, CRITICAL, * means all
        :type event_level: string
        :param event_type_list: event type list, * means all
        :type event_type_list: list
        :param eventAliasNames: event alias name list, * means all
        :type eventAliasNames: list
        Z
eventLevelZeventTypeListeventAliasNamesN)r   r`   r	   )r
   r   Zevent_type_listra   r   r   r   r	     s   	zEventFilter.__init__r   r   r   r   r   r`     r)   r`   c                       r#   )EventResourceFilterz1
    This class define event resource filter
    c                    2   t t|   || d< || d< || d< || d< dS )aq  

        :param region: region
        :type region: string
        :param type: resource type, enum: APP, SERVICE
        :type type: string
        :param monitor_object_type: monitor object type, enum: ALL, TAG
        :type monitor_object_type: string
        :param resources: resource list of EventResource
        :type resources: list of EventResource
        r_   r+   rA   rP   N)r   rb   r	   )r
   r_   r+   rB   rP   r   r   r   r	     s
   zEventResourceFilter.__init__r   r   r   r   r   rb     r)   rb   c                       r#   )EventResourcez*
    This class define event resource
    c                    s   t t|   || d< dS )zg
        :param identifiers: resource identifiers
        :type identifiers: list of Dimension
        rI   N)r   rd   r	   )r
   rI   r   r   r   r	     s   zEventResource.__init__r   r   r   r   r   rd     r)   rd   c                       s&   e Zd ZdZ		d fdd	Z  ZS )MonitorResourcez,
    This class define monitor resource
    Nc	           	         sR   t t|   || d< || d< || d< || d< || d< || d< || d< || d< d	S )
aO  
        :param user_id: user id
        :type user_id: string
        :param region: region
        :type region: string
        :param service_name: service name
        :type service_name: string
        :param type_name: type name
        :type type_name: string
        :param resource_id: resource id
        :type resource_id: string
        :param identifiers: identifier list
        :type identifiers: list of Dimension
        :param properties: property list
        :type properties: list of Dimension
        :param tags: tag list
        :type tags: list of Dimension
        ZuserIdr_   ZserviceNamerQ   Z
resourceIdrI   
propertiestagsN)r   re   r	   )	r
   Zuser_idr_   service_namerR   Zresource_idrI   rf   rg   r   r   r   r	     s   zMonitorResource.__init__)NNNr   r   r   r   r   re     s
    re   c                       r#   )MetricDatumz"
    This class metric datum.
    c                    rc   )a  
        :param metric_name: metric_name
        :type  metric_name: string
        :param dimensions: dimensions
        :type  dimensions: list
        :param value: value
        :type value: double
        :param timestamp: timestamp
        :type  timestamp: string
        rY   
dimensionsrD   	timestampN)r   ri   r	   )r
   r[   rj   rD   rk   r   r   r   r	     s
   zMetricDatum.__init__r   r   r   r   r   ri     rE   ri   c                       r#   )SiteAlarmRulez4
    This class define site alarm policy config
    c                    sj   t t|   || d< || d< || d< || d< || d< d| d< || d< || d	< |	| d
< |
| d< || d< dS )a  

        :param metric: metric identifier
        :type metric: string
        :param metric_alias: metric name
        :type metric_alias: string
        :param cycle: period, second
        :type cycle: int
        :param statistics: statistics, enum: average, minimum, maximum, sum
        :type statistics: string
        :param threshold:
        :type threshold: float
        :param comparison_operator: operator, enum: ">", "<", ">=", "<="
        :type: string
        :param count:
        :type count: int
        :param function:
        :type function: string
        :param act_on_idcs:
        :type act_on_idcs: list
        :param act_on_isps:
        :type act_on_isps: list
        :param version_site:
        :type version_site: string
        r1   r2   r3   r4   r5   r6   r7   r8   r9   Z	actOnIdcsZ	actOnIspsZversionSiteN)r   rl   r	   )r
   r1   r<   r3   r4   r5   r=   r9   r7   Zact_on_idcsZact_on_ispsZversion_siter   r   r   r	   5     zSiteAlarmRule.__init__r   r   r   r   r   rl   0  r)   rl   c                       r#   )CustomAlarmRulez6
    This class define custom alarm policy config
    c	           	         sZ   t t|   || d< || d< || d< || d< d| d< || d< || d< || d	< || d
< dS )ab  

        :param metric: metric identifier
        :type metric: string
        :param cycle: period, second
        :type cycle: int
        :param statistics: statistics, enum: average, minimum, maximum, sum
        :type statistics: string
        :param threshold:
        :type threshold: float
        :param comparison_operator: operator, enum: ">", "<", ">=", "<="
        :type: string
        :param count:
        :type count: int
        :param index: rule's sequence, begin with 0
        :type index: int
        :param metric_dimensions: dimensions
        :type metric_dimensions: list
        rY   r3   r4   r5   r6   r7   r8   r9   rT   r;   N)r   rn   r	   )	r
   r1   r3   r4   r5   r=   r9   rT   r>   r   r   r   r	   c  s   zCustomAlarmRule.__init__r   r   r   r   r   rn   ^  r)   rn   c                       (   e Zd ZdZ			d fdd	Z  ZS )SiteOnceConfigz,
    This class define site once config
    Nc                    s   t t|   || d< || d< || d< || d< || d< || d< || d< || d< |	| d	< |
| d
< || d< || d< || d< || d< dS )a
  

        :param anonymous_login: anonymous login
        :type anonymous_login: bool
        :param method: method, enum: get, post, put, delete, patch
        :type method: string
        :param post_content: post content
        :type post_content: string
        :param kidnap_white: kidnap white
        :type kidnap_white: bool
        :param resolve_type: resolve type
        :type resolve_type: string
        :param server: server
        :type server: string
        :param packet_count: packet count
        :type packet_count: int
        :param port: port
        :type port: int
        :param input_type: input type
        :type input_type: string
        :param input_data: input data
        :type input_data: string
        :param output_type: output type
        :type output_type: string
        :param expected_output: expected output
        :type expected_output: string
        :param username: username
        :type username: string
        :param password: password
        :type password: string
        ZanonymousLoginmethodZpostContentZkidnapWhiteZresolveTypeserverZpacketCountport	inputTypeinput
outputTypeexpectedOutputusernamepasswordN)r   rp   r	   )r
   Zanonymous_loginrq   Zpost_contentZkidnap_whiteZresolve_typerr   Zpacket_countrs   
input_type
input_dataoutput_typeexpected_outputrx   ry   r   r   r   r	     s   "zSiteOnceConfig.__init__)NNNNNNNNNNNNNNr   r   r   r   r   rp         rp   c                       ro   )AdvancedConfigz5
    This class define advanced site once config
    Nc                    sj   t t|   || d< || d< || d< || d< || d< || d< || d< || d< |	| d	< |
| d
< || d< dS )a  
       :param cookies: cookies
       :type cookies: string
       :param user_agent: user agent
       :type user_agent: string
       :param host: host
       :type host: string
       :param response_code: response code
       :type response_code: int
       :param response_check: response check
       :type response_check: bool
       :param username: username
       :type username: string
       :param password: password
       :type password: string
       :param input_type: input type
       :type input_type: string
       :param input_data: input data
       :type input_data: string
       :param output_type: output type
       :type output_type: string
       :param expected_output: expected output
       :type expected_output: string
       cookiesZ	userAgenthostZresponseCodeZresponseCheckrx   ry   rt   ru   rv   rw   N)r   r   r	   )r
   r   
user_agentr   Zresponse_codeZresponse_checkrx   ry   rz   r{   r|   r}   r   r   r   r	     rm   zAdvancedConfig.__init__)NNNNNNNNNNNr   r   r   r   r   r     r~   r   N)r   dictr   objectr   r$   r*   r-   r0   r?   r@   rC   rF   rH   rM   rS   rV   rW   r\   r^   r`   rb   rd   re   ri   rl   rn   rp   r   r   r   r   r   <module>   s6   %)6##.&8