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

refactor: update Request-SoSHealthJson to use the api #102

Merged
merged 9 commits into from
Mar 28, 2023

Conversation

garlicNova
Copy link
Contributor

@garlicNova garlicNova commented Mar 7, 2023

In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a pull request.

Summary of Pull Request

Transition SoS Health to /v1/system/health-summary API.

Signed-off-by: Kevin Teng kteng@vmware.com

Type of Pull Request

  • This is a bug fix.
  • This is an enhancement or feature.
  • This is a code style / formatting update.
  • This is a documentation update.
  • This is a refactoring update.
  • This is a chore update
  • This is something else.
    Please describe:

Related to Existing Issues

Closes #96

Test and Documentation Coverage

  • Tests have been completed (for bug fixes / features).
  • Documentation has been added / updated (for bug fixes / features).

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Breaks the use of Publish-LocalUserExpiry when running the health report. This will be resolved in #90 which must be completed for v2.0.0 to use Publish-PasswordHealth.

refact: Transition SoS Health to /v1/system/health-summary API
change function SoSHealthJson to use REST API for SoS Health calls

saved old function SoSHealthJson to SoSHealthJsonOld for backward compatibility

Signed-off-by: Kevin Teng <kteng@vmware.com>
@garlicNova garlicNova requested a review from a team as a code owner March 7, 2023 19:04
@github-actions github-actions bot added the needs-review Needs Review label Mar 7, 2023
@tenthirtyam tenthirtyam changed the title refact: Transition SoS Health to /v1/system/health-summary API refactor: transition sos health to /v1/system/health-summary api Mar 7, 2023
@tenthirtyam tenthirtyam added this to the v2.0.0 milestone Mar 7, 2023
@GaryJBlake
Copy link
Contributor

Is there a reason why we have not used PowerVCF for the API calls for SoS?

@tenthirtyam
Copy link
Contributor

Is there a reason why we have not used PowerVCF for the API calls for SoS?

Great point, Gary!

@garlicNova
Copy link
Contributor Author

Is there a reason why we have not used PowerVCF for the API calls for SoS?

I will look into it.

@tenthirtyam tenthirtyam added enhancement Enhancement refactor Refactor and removed needs-review Needs Review labels Mar 9, 2023
address all current comments

Signed-off-by: Kevin Teng <kteng@vmware.com>
@tenthirtyam tenthirtyam added the report/health Health Report label Mar 23, 2023
@vmwclabot
Copy link
Member

@garlicNova, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot vmwclabot added the dco-required DCO Required label Mar 23, 2023
@vmwclabot
Copy link
Member

@garlicNova, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@vmwclabot vmwclabot removed the dco-required DCO Required label Mar 23, 2023
Adds a workload domain example to the refactored `Request-SoSHealthJson` cmdlet.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@tenthirtyam tenthirtyam self-requested a review March 23, 2023 17:21
Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
Copy link
Contributor

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

Error observered on VMware Photon OS with PowerShell Core:

PS /home/vmware/code/VMware.CloudFoundation.Reporting> Import-Module ./VMware.CloudFoundation.Reporting.psm1                                                 PS /home/vmware/code/VMware.CloudFoundation.Reporting> Request-SoSHealthJson -server sfo-vcf01.sfo.rainpole.io -user admin@local -pass VMw@re1!VMw@re1! -reportPath /home/vmware/reports -workloadDomain sfo-w01
tar (child): /home/vmware/reports\\1I1K3C\\health-summary.tar.gz: Cannot open: No such file or directory             ]
tar (child): Error is not recoverable: exiting now
/usr/bin/tar: Child returned status 2
Copy-Item: Cannot find path '/health-results.json' because it does not exist.

Get-Content: Cannot find path '/home/vmware/reports/sfo-w01-all-health-results.json' because it does not exist.

/home/vmware/reports/sfo-w01-all-health-results.json

fix error on linux path / vs \

Signed-off-by: Kevin Teng <kteng@vmware.com>
@garlicNova
Copy link
Contributor Author

garlicNova commented Mar 28, 2023

Error observered on VMware Photon OS with PowerShell Core:

PS /home/vmware/code/VMware.CloudFoundation.Reporting> Import-Module ./VMware.CloudFoundation.Reporting.psm1                                                 PS /home/vmware/code/VMware.CloudFoundation.Reporting> Request-SoSHealthJson -server sfo-vcf01.sfo.rainpole.io -user admin@local -pass VMw@re1!VMw@re1! -reportPath /home/vmware/reports -workloadDomain sfo-w01
tar (child): /home/vmware/reports\\1I1K3C\\health-summary.tar.gz: Cannot open: No such file or directory             ]
tar (child): Error is not recoverable: exiting now
/usr/bin/tar: Child returned status 2
Copy-Item: Cannot find path '/health-results.json' because it does not exist.

Get-Content: Cannot find path '/home/vmware/reports/sfo-w01-all-health-results.json' because it does not exist.

/home/vmware/reports/sfo-w01-all-health-results.json

fixed, change hardcode path "backward slash" to use powershell cmdlets Join-Path to resolve issues between windows and linux. (backward slash vs forward slash)

@tenthirtyam tenthirtyam self-requested a review March 28, 2023 10:40
- Updates the version from v1.1.0 to v2.0.0 for next release milestone.
- Updates the GUID for the next release milestone.
- Updates the module description for the next release milestone.
- Updates the generated date to current; to be updated for the next release milestone.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@tenthirtyam tenthirtyam dismissed their stale review March 28, 2023 12:44

Ready for next review.

@tenthirtyam tenthirtyam added the size/m Relative Sizing: medium label Mar 28, 2023
@tenthirtyam
Copy link
Contributor

  • Updated the module version, GUID, and description in 97c698f.
  • Updates the CHANGELOG.md in 27d6c8d.

Updates `CHANGELOG.md`.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@tenthirtyam tenthirtyam changed the title refactor: transition sos health to /v1/system/health-summary api refactor: update Request-SoSHealthJson to use the api Mar 28, 2023
@tenthirtyam tenthirtyam merged commit 1f937d4 into vmware:main Mar 28, 2023
@tenthirtyam tenthirtyam added the breaking-change Breaking Change label Mar 28, 2023
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change Breaking Change enhancement Enhancement refactor Refactor report/health Health Report size/m Relative Sizing: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transition to the SoS Health /v1/system/health-summary/ APIs for bundle collection
4 participants