Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
184dd3db
Commit
184dd3db
authored
Oct 11, 2024
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: wip bulletin idea
parent
a8f2b3f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
308 additions
and
0 deletions
+308
-0
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_bulletin_event_to_propagate.xml
.../portal_alarms/slapos_crm_bulletin_event_to_propagate.xml
+115
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkBulletinEventToPropagate.py
...pos_crm_monitoring/Alarm_checkBulletinEventToPropagate.py
+13
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkBulletinEventToPropagate.xml
...os_crm_monitoring/Alarm_checkBulletinEventToPropagate.xml
+62
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Bulletin_checkEventToPropagate.py
...s/slapos_crm_monitoring/Bulletin_checkEventToPropagate.py
+56
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Bulletin_checkEventToPropagate.xml
.../slapos_crm_monitoring/Bulletin_checkEventToPropagate.xml
+62
-0
No files found.
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_bulletin_event_to_propagate.xml
0 → 100644
View file @
184dd3db
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_checkBulletinEventToPropagate
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_crm_bulletin_event_to_propagate
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_hour_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_frequency
</string>
</key>
<value>
<int>
12
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
1288051200.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
sense_method_id
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Check bulletin\'s events to propagate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkBulletinEventToPropagate.py
0 → 100644
View file @
184dd3db
portal
=
context
.
getPortalObject
()
activate_kw
=
{
'tag'
:
tag
}
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Bulletin'
,
causality__portal_type
=
'Compute Node'
,
simulation_state
=
'validated'
,
method_id
=
'Bulletin_checkEventToPropagate'
,
method_kw
=
{
'activate_kw'
:
activate_kw
},
activate_kw
=
activate_kw
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkBulletinEventToPropagate.xml
0 → 100644
View file @
184dd3db
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_checkBulletinEventToPropagate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Bulletin_checkEventToPropagate.py
0 → 100644
View file @
184dd3db
portal
=
context
.
getPortalObject
()
bulletin
=
context
if
bulletin
.
getSimulationState
()
!=
'validated'
:
return
compute_node
=
bulletin
.
getCausalityValue
(
portal_type
=
'Compute Node'
)
if
compute_node
is
None
:
return
# Get the list of private notes
note_list
=
portal
.
portal_catalog
(
portal_type
=
'Note'
,
simulation_state
=
[
'stopped'
,
'delivered'
],
follow_up__uid
=
bulletin
.
getUid
()
)
# Get the list of compute node customers
grouped_instance_list
=
portal
.
portal_catalog
(
portal_type
=
[
'Software Instance'
,
'Slave Instance'
],
group_by
=
[
'specialise_uid'
],
aggregate__uid
=
[
x
.
uid
for
x
in
compute_node
.
contentValues
(
portal_type
=
'Compute Partition'
)]
)
grouped_instance_tree_list
=
portal
.
portal_catalog
(
portal_type
=
'Instance Tree'
,
group_by
=
[
'destination_section_uid'
],
uid
=
[
x
.
getSpecialiseUid
()
for
x
in
grouped_instance_list
]
)
customer_list
=
[
x
.
getDestinationSectionValue
()
for
x
in
grouped_instance_tree_list
]
customer_uid_list
=
[
x
.
getUid
()
for
x
in
customer_list
]
# Check if every customer received an Acknowledgement for every Note
for
note
in
note_list
:
note
=
note
.
getObject
()
# Search existing ones
acknowledgement_customer_uid_list
=
[
x
.
getDestinationUid
()
for
x
in
portal
.
portal_catalog
(
portal_type
=
'Acknowledgement'
,
destination_uid
=
customer_uid_list
,
follow_up__uid
=
bulletin
.
getUid
(),
causality__uid
=
note
.
getUid
()
)]
# Calculate missing ones
for
customer
in
customer_list
:
if
customer
.
getUid
()
not
in
acknowledgement_customer_uid_list
:
# And create it
bulletin
.
Ticket_createProjectEvent
(
note
.
getTitle
(),
'outgoing'
,
'Acknowledgement'
,
note
.
getResource
(),
note
.
getTextContent
(),
note
.
getContentType
(),
destination
=
customer
)
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Bulletin_checkEventToPropagate.xml
0 → 100644
View file @
184dd3db
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
activate_kw=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Bulletin_checkEventToPropagate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment