Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • fusiondirectory-orchestrator fusiondirectory-orchestrator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fusiondirectoryfusiondirectory
  • fusiondirectory-orchestratorfusiondirectory-orchestrator
  • Merge requests
  • !80
An error occurred while fetching the assigned milestone of the selected merge_request.

Resolve "[Orchestrator] - Create a librabry in core orchestrator"

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Alexa Oana eliza requested to merge 73-orchestrator-create-a-librabry-in-core-orchestrator into dev 1 month ago
  • Overview 0
  • Commits 22
  • Pipelines 17
  • Changes 1

Related to #73

Viewing commit a3811228
Prev Next
Show latest version
1 file
+ 4
− 6

    Preferences

    File browser
    Compare changes
  • a3811228
    dockx thibault
    :sparkles: feat(archive) - update archive request settings and improve error... · a3811228
    dockx thibault authored 1 month ago
    :sparkles: feat(archive) - update archive request settings and improve error handling for unexpected HTTP status codes
plugins/tasks/Archive.php
+ 4
− 6
  • View file @ a3811228

  • Edit in single-file editor

  • Open in Web IDE


@@ -55,17 +55,15 @@ class Archive implements EndpointInterface
// Set the archive endpoint and method using the same WebServiceCall object
$archiveUrl = $_ENV['FUSION_DIRECTORY_API_URL'] . '/archive/user/' . rawurlencode($task['fdtasksgranulardn'][0]);
$webServiceCall->setCurlSettings($archiveUrl, [], 'POST'); // Update settings for the archive request
$webServiceCall->setCurlSettings($archiveUrl, NULL, 'POST'); // Update settings for the archive request
$response = $webServiceCall->execute();
print_r([$response]);
exit;
if (isset($response['success']) && $response['success'] === true) {
// Check if the HTTP status code is 204
if ($webServiceCall->getHttpStatusCode() === 204) {
$result[$task['dn']]['result'] = "User successfully archived.";
$this->gateway->updateTaskStatus($task['dn'], $task['cn'][0], '2');
} else {
throw new Exception("Invalid API response format");
throw new Exception("Unexpected HTTP status code: " . $webServiceCall->getHttpStatusCode());
}
} catch (Exception $e) {
$result[$task['dn']]['result'] = "Error archiving user: " . $e->getMessage();
Assignee
Alexa Oana eliza's avatar
Alexa Oana eliza
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 Participants
Reference:
Source branch: 73-orchestrator-create-a-librabry-in-core-orchestrator

Menu

Explore Projects Groups Topics Snippets