Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprovisioning Notification #6672

Merged
merged 5 commits into from
Jul 10, 2023
Merged

Conversation

kobergj
Copy link
Collaborator

@kobergj kobergj commented Jun 29, 2023

Adds global notifications to userlog service

To store a deprovision notification POST on /global endpoint:

curl --insecure -X POST -v -u admin:admin -d '{"type":"deprovision", "data":{"deprovision_date": "2023-07-04T12:23:12Z"}}' https://localhost:9200/ocs/v2.php/apps/notifications/api/v1/notifications/global

You can define the format of the date with the deprovision_date_format parameter

curl --insecure -X POST -v -u admin:admin -d '{"type":"deprovision", "data":{"deprovision_date": "2023-07-04 15:17", "deprovision_date_format":"2006-01-02 15:04"}}' https://localhost:9200/ocs/v2.php/apps/notifications/api/v1/notifications/global 

See go time formating for format details

To delete a deprovision notification DELETE on /global endpoint

curl --insecure -X DELETE -v -u admin:admin -d '{"ids":["deprovision"]}' https://localhost:9200/ocs/v2.php/apps/notifications/api/v1/notifications/global 

NOTE: non admin users will only get a 404 NOT FOUND on both endpoints

@update-docs
Copy link

update-docs bot commented Jun 29, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@ownclouders
Copy link
Contributor

💥 Acceptance test localApiTests-apiSpacesShares-ocis failed. Further test are cancelled...

@kobergj kobergj force-pushed the DeprovisionNotification branch 2 times, most recently from d43d1c8 to 378b4ef Compare July 6, 2023 13:06
@kobergj kobergj marked this pull request as ready for review July 6, 2023 13:07
@kobergj
Copy link
Collaborator Author

kobergj commented Jul 6, 2023

@mmattel mind having a look on readme changes? 🥺

@kobergj kobergj force-pushed the DeprovisionNotification branch from 378b4ef to 22ba896 Compare July 6, 2023 13:09
services/userlog/README.md Outdated Show resolved Hide resolved
services/userlog/README.md Outdated Show resolved Hide resolved
@kobergj kobergj force-pushed the DeprovisionNotification branch 2 times, most recently from faa71f3 to 71e5273 Compare July 6, 2023 15:27
@mmattel
Copy link
Contributor

mmattel commented Jul 6, 2023

@EParzefall mind to have a look on the text changes I made for in depth improvements?

services/userlog/README.md Outdated Show resolved Hide resolved
services/userlog/README.md Outdated Show resolved Hide resolved
@kobergj kobergj force-pushed the DeprovisionNotification branch from f05e8a4 to 9cf0700 Compare July 7, 2023 09:07
Signed-off-by: jkoberg <[email protected]>
@kobergj kobergj force-pushed the DeprovisionNotification branch from 9cf0700 to ff61d25 Compare July 7, 2023 09:29
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

6.7% 6.7% Coverage
0.0% 0.0% Duplication

@@ -54,6 +54,11 @@ var (
Subject: Template("Share expired"),
Message: Template("Access to {resource} expired"),
}

PlatformDeprovision = NotificationTemplate{
Subject: Template("Instance will be shut down and deprovisioned"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shockmessage, should be more softer IMHO like "Instance will be shutdown in %d days|months"

/cc @mmattel

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 good point. Will open new PR for it because of the current CI issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants